Hugging Face

StarCoder2

Self-host onlySmall memory

StarCoder2 is Hugging Face's small-memory model. This page shows current pricing, an interactive cost calculator, and a side-by-side with similar models.

Input

β€”

Output

β€”

Cached

β€”

Batch

β€”

Interactive

Calculate your StarCoder2 bill.

Adjust the workload below and watch the monthly cost update in real time.

What would StarCoder2 cost you?

Adjust the workload to see your monthly bill.

1,00010,00050,000250,0001M10M

Technical specifications

StarCoder2 at a glance.

Memory

16,384

tokens

Max reply

β€”

tokens

Memory tier

Small

a few emails or a short document

Tokenizer

default

Released

β€”

Training cutoff

β€”

Availability

Self-host only

Status

active

What it can do

Capabilities & limits.

  • Understands images
  • Deep step-by-step thinking
  • Uses tools / calls functions
  • Strict JSON output
  • Streams replies
  • Fine-tunable on your data

When to pick StarCoder2

  • High-volume workloads where unit cost matters.
  • Code generation, review, or refactoring.

When to look elsewhere

  • You need a managed endpoint β€” this one is self-host only.
  • Your workload involves images β€” pick a vision-capable model instead.
  • You need tool-use / function calling for agent workflows.
  • Your inputs routinely exceed short documents.

FAQ

StarCoder2 β€” the questions we see most.

Pricing, capabilities, alternatives β€” generated from the same data that powers the calculator above.

Get instant answers from our AI agent

StarCoder2 is an open-weight model with no managed endpoint β€” you run it on your own GPUs, so the cost depends on your hardware choice rather than a per-token price. Hosted providers like Together AI, Fireworks, or Replicate offer it from around $0.20–$2.00 per 1M tokens depending on size.
StarCoder2 has a 16,384-token context window (small memory β€” a few emails or a short document). That means you can fit about 3,072 words of input and history in a single call.
Models in a similar class include devstral-small-2505, Codestral, DeepSeek V3.2. The "Similar models" section below this FAQ links into each.

Still unsure?

Compare StarCoder2 against 100+ other models.

Open the full wizard β€” pick a use case, set your usage, and see side-by-side monthly costs in under a minute.