50 models7 providersprices scraped nightly — no estimates
Head to headMay 27, 2026

Phi-3 Medium 128K vs StarCoder2 15B Instruct

Side-by-side on verified pricing, benchmarks, and provider availability.

DimensionPhi-3 Medium 128KStarCoder2 15B Instruct
Cheapest $/1M out
Cheapest $/1M in
Cheapest provider
Capabilities
Context window131K16K
Parameters14B15B
Licensemitbigcode-openrail-m
Released2024-05-212024-09-06
Verdict

Phi-3 Medium 128K and StarCoder2 15B Instruct are comparable in size but built for different audiences. StarCoder2 15B is a code-specialized model trained on 600+ programming languages via The Stack v2; it achieves HumanEval pass@1 around 46–52% and excels at code completion, infilling, and repository-level generation. Phi-3 Medium is a general-purpose model with strong coding capability (HumanEval ~84%) due to its curated training data, plus a 128K context window for long-document tasks. Pricing is similar — $0.20–$0.40/M tokens — though StarCoder2 15B is often available cheaper on providers that specialize in code models.

StarCoder2's fill-in-the-middle (FIM) training makes it uniquely suited for code completion tasks inside editors or CI pipelines where the model needs to infer from both preceding and following context. This is a structural advantage Phi-3 Medium doesn't replicate.

**Where StarCoder2 15B wins:** IDE autocomplete integration, code infilling, multi-file repository generation, and scenarios requiring coverage across niche programming languages. Its 16K context is adequate for most file-level tasks.

**Where Phi-3 Medium 128K wins:** mixed workloads that combine code with natural language — technical documentation, code explanation, long-context reasoning over codebases where 128K context matters, and general Q&A alongside coding assistance.

Pick [StarCoder2 15B Instruct](/models/bigcode--starcoder2-15b-instruct) for pure-code generation, infilling, or polyglot coverage where a specialized architecture outperforms a general model. Pick [Phi-3 Medium 128K](/models/microsoft--phi-3-medium-128k) when your workload mixes code and text, or when long-context processing is required.

Sample workload

5M in + 2M out / month — cheapest provider each

Phi-3 Medium 128K
StarCoder2 15B Instruct

What changes at scale

$/mo estimate

Output tokens dominate cost above a 1:3 input/output ratio. Below 1:1, input dominates and cheaper-input providers win regardless of headline price.

1M in · 250K out ·
5M in · 2M out ·
20M in · 10M out ·
100M in · 60M out ·
Calculate cost for your workload

Compare total monthly cost across providers for Phi-3 Medium 128K and StarCoder2 15B Instruct using your own input/output token mix.

Open workload calculator →
Full model details