CodeGemma 2B is Google's language model with a 8K context window and up to 8K output tokens, starting at $0.1 / 1M input and $0.1 / 1M output. Lightweight 2B-parameter code generation model built on Gemma, supporting text-to-text and text-to-code tasks with a small footprint.
Capabilities
Input1/5
Text✓
Image·
Audio·
Video·
PDF·
Output1/5
Text✓
Image·
Audio·
Video·
Embedding·
Capabilities0/13
Reasoning·
Adaptive Reasoning·
Function Calling·
Parallel Function Calling·
Structured Outputs·
Native JSON Schema·
Web Search·
URL Context·
Computer Use·
Code Execution·
File Search·
Prompt Caching·
Assistant Prefill·
Pricing by Provider
US Dollar ($)
Per 1M tokens
| Provider | Standard | |
|---|---|---|
| Input $ / 1M | Output $ / 1M | |
| $0.1 | $0.1 | |
Cost Calculator
US Dollar ($)
Preset:
Cheapest Instances to Run It
Cloud GPU instances that can host CodeGemma 2B, ranked by cheapest on-demand price. The model needs about 5 GB of GPU memory at FP16 precision (estimated from its parameter count), so treat the fit as guidance rather than a guarantee.
All clouds
FP16 (full precision)
US Dollar ($)
Instance | Cloud | GPU | VRAM | Price | Cheapest region | |
|---|---|---|---|---|---|---|
| Standard_NV4as_v4 | AMD Radeon Instinct MI25 | 16 GB | $0.233/hr | westus2 | ||
| g4ad.xlarge | Radeon Pro V520 | 8 GB | $0.379/hr | us-east-1 | ||
| g5g.xlarge | T4g | 16 GB | $0.420/hr | us-east-1 | ||
Versions
| Version | Released | Context | Input / 1M | Output / 1M | Status |
|---|---|---|---|---|---|
| Gemma 4 31B | — | 256K | $0.140 | $0.400 | Available |
| Gemma 4 26B A4B | — | 256K | $0.130 | $0.400 | Available |
| Gemma 4 12B | — | — | — | — | Available |
| Gemma 4 31B | — | — | — | — | Available |
| Gemma 4 26B A4B | — | — | — | — | Available |
| Gemma 4 E4B | — | — | — | — | Available |
| Gemma 4 E2B | — | 128K | $0.040 | $0.080 | Available |
| Gemma 4 E4B | — | — | — | — | Available |
| Gemma 4 E2B | — | — | — | — | Available |
| Gemma 4 | — | — | — | — | Available |
| CodeGemma 2B | — | 8K | $0.100 | $0.100 | Current |