Gemma 2 (9B) (Deprecated) API

Gemma 2 (9B): Efficient, open-source language model with competitive performance.
Output

Overview

Gemma 2 (9B) Description

  • Model Name: Google Gemma 2 (9B)
  • Developer: Google
  • Release Date: 2024
  • Version: 2
  • Model Type: Text (Language Model)

Gemma 2 (9B) is a 9 billion parameter language model that offers competitive performance compared to larger models while maintaining a practical size. It is designed to be an open model, allowing for widespread use and adaptation by the developer community.

Key Features
  • Interleaved local-global attentions
  • Group-query attention
  • Trained using knowledge distillation
  • Competitive performance against models 2-3 times larger
  • Open-source availability

Technical Details

Architecture

The Gemma 2 (9B) model incorporates several technical modifications to enhance its performance:

  1. Interleaved local-global attentions: This technique, based on the work of Beltagy et al. (2020a), allows the model to efficiently process both local and global context information.
  2. Group-query attention: Implemented based on the research by Ainslie et al. (2023), this mechanism likely improves the model's ability to handle complex queries and relationships within the text.
  3. Knowledge distillation: Unlike its predecessor, which used next token prediction, Gemma 2 (9B) is trained using knowledge distillation techniques. This approach, pioneered by Hinton et al. (2015), allows the model to learn from a larger, more complex model while maintaining a smaller size.
Performance Metrics

The model is described as delivering "the best performance for their size" and offering "competitive alternatives to models that are 2-3 × bigger".

Usage

Code samples
Ethical Considerations

While not explicitly mentioned in the provided information, it's important for developers to consider potential biases in the model's outputs and use it responsibly. As with any large language model, care should be taken to ensure that the model's responses are appropriate and do not perpetuate harmful biases or misinformation.

Licensing

Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms

Conclusion

Google Gemma 2 (9B) represents a significant step forward in the development of efficient and powerful language models. Its innovative architecture and training techniques allow it to achieve impressive performance while maintaining a relatively small size. This makes it an attractive option for developers who need high-quality language processing capabilities but may have constraints on computational resources.For software developers looking to integrate advanced language processing into their applications, Gemma 2 (9B) offers a compelling balance of performance and practicality. Its open-source nature also allows for customization and fine-tuning to specific use cases, making it a versatile tool in the natural language processing toolkit.

Use cases

  • chatbots and conversational agents with deep reasoning and knowledge
  • question-answering systems for research and customer support
  • generating long-form text including summaries, explanations, and narratives
  • instruction-following AI assistants for diverse NLP tasks
  • efficient deployment on diverse hardware setups for real-time inference
  • academic research and fine-tuning for specialized domains and tasks
  • applications requiring cost-effective large language model inference with high performance

How to use Gemma 2 (9B) (Deprecated) API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to .

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Gemma 2 (9B) (Deprecated) API Pricing

TypePrice
Input
Output

Gemma 2 (9B) (Deprecated) Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
MMLU
71.3
Multi-discipline knowledge across 57 school and professional subjectsSourceSeptember 21, 2026
GSM8K
68.6
Grade-school maths word problems requiring multi-step arithmeticSourceSeptember 21, 2026
HumanEval
40.2
Python function synthesis from a docstring, scored by unit tests (pass@1)SourceSeptember 21, 2026
MATH
36.6
Competition mathematics problems across five difficulty levelsSourceSeptember 21, 2026
HellaSwag
81.9
Commonsense sentence completion with adversarially filtered wrong endingsSourceSeptember 21, 2026

Gemma 2 (9B) (Deprecated) vs other models

ModelInputOutputContextBest for
$5 / 1M tokens
$30 / 1M tokens
1M tokens
Reasoning + agents
$2 / 1M tokens
$10 / 1M tokens
1M tokens
Balanced coding + agents
$3 / 1M tokens
$15 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$1.5 / 1M tokens
$9 / 1M tokens
1M tokens
Reasoning + agents

Frequently asked questions

Yes, Gemma 2 (9B) (Deprecated) can stream responses as they are generated.

Yes, Gemma 2 (9B) (Deprecated) supports both function calling and structured outputs.

Gemma 2 (9B) (Deprecated) was built by Google.

This model is marked as deprecated.

Start building with Gemma 2 (9B) (Deprecated)

Get API Key
1000+ models, one API.