# Text Embedding 005

High-performance English text embeddings with dynamic dimension control: text-embedding-005 achieves strong retrieval and semantic similarity quality at 768 dimensions while offering smaller output sizes for cost-sensitive deployments.

- **Model ID:** `google/text-embedding-005`
- **Type:** embedding
- **Providers:** vertex
- **Context window:** Not applicable
- **Maximum output tokens:** 0
- **Pricing:** $0.025/1M input tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/text-embedding-005

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { embed } from 'ai';

const result = await embed({
  model: 'google/text-embedding-005',
  value: 'Sunny day at the beach',
})
```

## About

Text Embedding 005 is Google's English-language text embedding model built on the Gecko architecture, which uses knowledge distillation from large language models (LLMs) to achieve competitive downstream task performance at a compact embedding size. At its full 768-dimension output, the model scores 66.31% on the MTEB benchmark, a standard evaluation suite covering eight categories including retrieval, reranking, clustering, classification, and semantic similarity.

This means Text Embedding 005 delivers competitive retrieval and similarity quality without requiring high-dimensional vector indices.

Dynamic embedding sizes are supported through Matryoshka Representation Learning (MRL), which trains the model to produce accurate representations at multiple dimension levels from a single pass. At 256 dimensions, it scores 64.37% on MTEB, a two-point reduction that may be an acceptable tradeoff when vector storage costs at scale are significant. This flexibility is built into the model architecture, not post-hoc dimension reduction.

## What to consider

When choosing between 256- and 768-dimension outputs, Text Embedding 005 shows a performance difference of approximately 2 percentage points on MTEB (64.37% vs 66.31%). For cost-sensitive applications with high vector storage volume, 256 dimensions can meaningfully reduce infrastructure costs with a modest quality tradeoff.

## When to use

### Best For
- English-language semantic search and document retrieval applications
- Clustering and classification tasks over English text corpora
- Vector similarity applications where 768-dimension indices are the standard infrastructure choice
- Cost-sensitive deployments that can use 256-dimension output to reduce storage and compute
- Applications built on Google Cloud services (BigQuery, Vertex AI Search) that are already in the Gecko model family

### Consider Alternatives When
- Your corpus includes non-English text or mixed multilingual content (consider `google/text-multilingual-embedding-002`)
- You need higher embedding dimensions than 768 for maximum theoretical discriminative power

## Best for

- **English semantic search:** Document retrieval over English corpora, with a 66.31% MTEB score at the full 768-dimension output
- **English clustering and classification:** Grouping and labeling tasks over English text corpora at 768 dimensions
- **768-dimension vector similarity:** Applications where 768-dimension indices are the standard infrastructure choice
- **Cost-sensitive deployments:** Use 256-dimension output to reduce storage and compute
- **Google cloud integrations:** Applications on BigQuery or Vertex AI Search that are already in the Gecko model family

## Consider alternatives

- **Multilingual content:** Your corpus includes non-English text or mixed languages (consider `google/text-multilingual-embedding-002`)
- **Higher dimensions needed:** You need more than 768 dimensions for maximum theoretical discriminative power

## Frequently asked questions

### What is the MTEB score for text-embedding-005?

Text Embedding 005 scores 66.31% on average on MTEB at 768 dimensions. At 256 dimensions using dynamic sizing, it scores 64.37%. MTEB covers eight English NLP task categories including retrieval, reranking, clustering, classification, and semantic similarity.

### What is dynamic embedding size and how does it work?

The model uses Matryoshka Representation Learning to produce accurate embeddings at multiple dimension levels from a single inference pass. Users can request 256 or 768-dimension output. This is a training-level capability, not post-hoc truncation, which preserves more information per dimension at smaller sizes.

### When should I choose 256 dimensions over 768 dimensions?

Use 256 dimensions when vector storage costs at scale are a constraint and the approximately 2-point MTEB score difference is acceptable for your use case. Use 768 dimensions for maximum retrieval accuracy.

### Does text-embedding-005 support multilingual content?

No. This is an English-only model. For multilingual or non-English embedding tasks, use `google/text-multilingual-embedding-002`.

### What tasks does this model perform well on?

The model performs well on retrieval, reranking, clustering, classification, and semantic similarity across the eight MTEB task categories.

### What is the pricing for text-embedding-005?

Check the pricing panel on this page for today's numbers. AI Gateway tracks rates across every provider that serves Text Embedding 005.

### How does text-embedding-005 compare to larger embedding models?

At 768 dimensions, the model competes well against MTEB entries of the same embedding size and models with significantly more parameters or higher dimensionality. This makes it an efficient choice for applications where inference cost and vector storage size matter.

## Links

- [Model page](https://vercel.com/ai-gateway/models/text-embedding-005)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api)
- [Provider pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing)
