Llama 4 Scout 17B 16e Instruct vs Mai Code 2 Flash
As of December 2, 2026, Mai Code 2 Flash and Llama 4 Scout 17B 16e Instruct cost the same per input token ($0.05 per 1M), but Mai Code 2 Flash costs 150% more per output token ($0.25 vs $0.10) and has a 922K-token context window versus 16K.
Llama 4 Scout 17B 16e Instruct vs Mai Code 2 Flash side by side
| Llama 4 Scout 17B 16e Instruct | Mai Code 2 Flash | |
|---|---|---|
| Input, per 1M tokens | $0.05 | $0.05 |
| Output, per 1M tokens | $0.10 | $0.25 |
| Cache read, per 1M tokens | – | $0.005 |
| Cache write, per 1M tokens | – | – |
| Context window | 16,384 tokens | 922,000 tokens |
| Max output | 8,192 tokens | 128,000 tokens |
| Image input | Yes | Yes |
| Tool calling | Yes | Yes |
| Structured output (JSON) | – | Yes |
| Prompt caching | – | – |
| Reasoning | – | Yes |
| Providers on LiteLLM | 11 | 2 |
| Price shown is from | Lambda | Azure AI Foundry |
| Added to LiteLLM | April 2025 | November 17, 2026 |
Cheapest provider for each
- Llama 4 Scout 17B 16e Instruct: Lambda at $0.05 input and $0.10 output per 1M tokens (
lambda_ai/llama-4-scout-17b-16e-instruct) - Mai Code 2 Flash: Azure AI Foundry at $0.05 input and $0.25 output per 1M tokens (
azure_ai/MAI-Code-2-Flash)
When to pick which
Pick Llama 4 Scout 17B 16e Instruct for
- Costs 60% less per output token: $0.10 vs $0.25 per 1M.
- Available from 11 providers through LiteLLM, vs 2.
Pick Mai Code 2 Flash for
- Larger context window: 922,000 vs 16,384 tokens.
- Returns up to 128,000 tokens per response, vs 8,192.
From differences in the data above only; where the data is equal, no reason is given.
Call Llama 4 Scout 17B 16e Instruct or Mai Code 2 Flash with LiteLLM
Both use the OpenAI format through LiteLLM, so switching is a model name change. Set each provider's API key in the environment first.
from litellm import completion
messages = [{"role": "user", "content": "Hello!"}]
# Llama 4 Scout 17B 16e Instruct
response = completion(model="lambda_ai/llama-4-scout-17b-16e-instruct", messages=messages)
# Mai Code 2 Flash
response = completion(model="azure_ai/MAI-Code-2-Flash", messages=messages)
# Llama 4 Scout 17B 16e Instruct, falling back to Mai Code 2 Flash if the call fails
response = completion(model="lambda_ai/llama-4-scout-17b-16e-instruct", messages=messages, fallbacks=["azure_ai/MAI-Code-2-Flash"])FAQ
Which is cheaper, Llama 4 Scout 17B 16e Instruct or Mai Code 2 Flash?
Llama 4 Scout 17B 16e Instruct is cheaper at 3 input tokens per output token: $0.0625 per 1M tokens blended ($0.05 input, $0.10 output), versus $0.10 ($0.05 and $0.25) for Mai Code 2 Flash, as of December 2, 2026.
Which has the larger context window, Llama 4 Scout 17B 16e Instruct or Mai Code 2 Flash?
Mai Code 2 Flash has the larger context window: 922,000 tokens, versus 16,384 for Llama 4 Scout 17B 16e Instruct.
Can I switch from Llama 4 Scout 17B 16e Instruct to Mai Code 2 Flash without changing my code?
Yes. Through LiteLLM both use the OpenAI format, so switching means changing the model name from "lambda_ai/llama-4-scout-17b-16e-instruct" to "azure_ai/MAI-Code-2-Flash", or pointing a LiteLLM gateway model alias at the other model. You can also use one as a fallback for the other.