Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pytest
pytest-cov
pytest-xdist
requests
numpy
openai
langchain~=1.2
langchain-openai~=1.1
Expand Down
18 changes: 6 additions & 12 deletions v3/llms/embeddings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
proficiencyLevel="Intermediate"
keywords={["Eden AI", "AI API", "LLM API", "chat completion", "OpenAI compatible"]}
datePublished="2026-05-06T00:00:00Z"
dateModified="2026-05-07T00:00:00Z"
dateModified="2026-05-22T00:00:00Z"
/>

Embeddings turn text into numerical vectors that capture meaning. They are the foundation for [RAG pipelines](#use-cases), semantic search, recommendations, and clustering.
Expand All @@ -37,7 +37,7 @@
- **Semantic search** — match queries against documents by meaning, not keywords.
- **Recommendations** — suggest similar products, articles, or songs based on description vectors.
- **Clustering and topic discovery** — group thousands of texts by meaning without labels.
- **Deduplication** — find near-duplicates that don't share exact wording.

Check warning on line 40 in v3/llms/embeddings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (edenai) - vale-spellcheck

v3/llms/embeddings.mdx#L40

Did you really mean 'Deduplication'?
- **Anomaly detection** — flag inputs that look unlike anything in your corpus.
- **Classification** — train a small classifier on top of frozen embeddings instead of fine-tuning a full model.

Expand All @@ -56,18 +56,14 @@
```python Python
import requests

response = requests.get(
"https://api.edenai.run/v3/embeddings/models",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
response = requests.get("https://api.edenai.run/v3/embeddings/models")

for model in response.json()["data"]:
print(model["id"], "-", model.get("context_length"))
```

```bash cURL
curl https://api.edenai.run/v3/embeddings/models \
-H "Authorization: Bearer YOUR_API_KEY"
curl https://api.edenai.run/v3/embeddings/models
```
</CodeGroup>

Expand All @@ -83,9 +79,8 @@

headers = {"Authorization": "Bearer YOUR_API_KEY"}

model_id = requests.get(

Check warning on line 82 in v3/llms/embeddings.mdx

View check run for this annotation

Mintlify / Mintlify Validation (edenai) - vale-spellcheck

v3/llms/embeddings.mdx#L82

Did you really mean 'model_id'?
"https://api.edenai.run/v3/embeddings/models",
headers=headers,
).json()["data"][0]["id"]

response = requests.post(
Expand Down Expand Up @@ -124,10 +119,9 @@
API_KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}

# 1. Pick a model from the catalog.
# 1. Pick a model from the catalog (no auth required for /models).
model_id = requests.get(
"https://api.edenai.run/v3/embeddings/models",
headers=headers,
).json()["data"][0]["id"]

# 2. Define a query and a corpus of documents to search over.
Expand Down Expand Up @@ -172,7 +166,7 @@
| `model` | string | yes | `provider/model` from `/v3/embeddings/models`. |
| `input` | string \| string[] \| int[] \| int[][] | yes | Text to embed, or a batch. Pre-tokenized integer inputs are also accepted. |
| `encoding_format` | `"float"` \| `"base64"` | no | Defaults to `"float"`. `"base64"` reduces wire payload size. |
| `dimensions` | integer | no | Truncate the output vector. Only supported by models that advertise it (3-series). |
| `dimensions` | integer | no | Truncate the output vector. Only supported by models that advertise it (e.g. `openai/text-embedding-3-small` and `openai/text-embedding-3-large`). |
| `user` | string | no | End-user identifier for abuse tracking. |
| `metadata` | object | no | Eden extension. Free-form metadata stored with the request. |

Expand Down Expand Up @@ -217,7 +211,7 @@
- **Small / fast / cheap** (e.g. `*-small` variants) — good default for most semantic-search workloads. Lower latency, lower cost per token, vectors are smaller so storage and dot products are faster.
- **Large / higher quality** (e.g. `*-large` variants) — meaningfully better recall on hard retrieval tasks (long technical docs, multilingual corpora). Costs more and produces larger vectors.
- **Context length** — long-context embedding models let you embed entire documents without chunking. Most 8k-context models still need chunking for paragraphs above ~2k tokens.
- **Dimensions** — some 3-series models support a `dimensions` parameter to truncate outputs. Smaller vectors save storage and speed up similarity search at a small recall cost.
- **Dimensions** — some models (e.g. `openai/text-embedding-3-small` and `openai/text-embedding-3-large`) support a `dimensions` parameter to truncate outputs. Smaller vectors save storage and speed up similarity search at a small recall cost.
- **Multilingual** — verify language support in the model's `capabilities` before using it for non-English corpora.

A common pattern: prototype with a small model, then A/B test a larger model on your evaluation set before committing to the storage cost.
Expand Down
Loading