LiteLLMLiteLLM/ MODELS

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.

Prices from LiteLLM's price fileChecked

Llama 4 Scout 17B 16e Instruct vs Mai Code 2 Flash side by side

Headline prices in US dollars per 1M tokens: each model's own lab where it sells it, otherwise its cheapest provider. Source: LiteLLM model price file, as of December 2, 2026.
Llama 4 Scout 17B 16e InstructMai 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 window16,384 tokens922,000 tokens
Max output8,192 tokens128,000 tokens
Image inputYesYes
Tool callingYesYes
Structured output (JSON)–Yes
Prompt caching––
Reasoning–Yes
Providers on LiteLLM112
Price shown is fromLambdaAzure AI Foundry
Added to LiteLLMApril 2025November 17, 2026

Cheapest provider for each

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.

Python SDK
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.