Gemma 2 27B

Google Gemma 2 Generally Available Jun 2024

Google's 27B open-weight model from the Gemma 2 family. Competitive with Llama 3 70B on many benchmarks at a fraction of the size, using a novel interleaved attention architecture.

Context
8K
tokens
Input
$0.65
per MTok
Output
$0.65
per MTok

About

Gemma 2 27B by Google is an open model built from the same research and technology used to create the [Gemini models](/models?q=gemini). Gemma models are well-suited for a variety of...

Modalities

Input
Text Code
Output
Text Code

Code Examples

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemma-2-27b",
    "messages": [
      { "role": "user", "content": "Explain quantum entanglement in one sentence." }
    ]
  }'

API Parameters

Name Type Description
frequency_penalty number Penalize tokens by their frequency so far. Positive values reduce repetition.
max_tokens deprecated integer Deprecated. Use max_completion_tokens.
presence_penalty number Penalize tokens that have appeared at all so far. Positive values encourage new topics.
repetition_penalty number Penalize repeated tokens (>1.0 reduces repetition, <1.0 encourages it).
response_format one of Constrain output to a JSON schema or an enum (structured outputs).
seed integer Deterministic seed for sampling. Same seed + same prompt produces identical output.
stop array Up to 4 sequences where the API will stop generating tokens.
structured_outputs boolean Enable JSON-schema-constrained output.
temperature number Sampling temperature; higher values produce more random output. 0 is deterministic.
top_p number Nucleus sampling: consider only tokens whose cumulative probability ≥ top_p.

Standard OpenAI-compatible parameters. Consult the provider docs for model-specific behaviour.

Benchmark Scores

Benchmark Score
MMLU 75.2%
HumanEval 51.8%
MATH 42.3%
GSM8K 74%

Performance

90
tok / sec
output speed

Source: Gemma 2 technical paper + Artificial Analysis, April 2026

Strengths & Limitations

Best For
Compact 27B for strong benchmark scores
Gemma licence allows broad use
Interleaved local/global attention
Good for on-device or limited-GPU deployments
Limitations
8K context window only
No vision, audio, or tool use in base model
Superseded by Gemma 3 for new deployments

Tags

Open WeightsEfficientCodingReasoning