Are you an LLM? You can read better optimized documentation at /en/capabilities/embedding.md for this page in Markdown format
Embedding (Vectors)
Turns text into a fixed-size vector. The foundation for RAG, semantic search and similarity comparisons.
Available models
| Model | Dimensions | Languages |
|---|---|---|
veriEmbedding (recommended) | 1024 | TR + EN + 100+ (multilingual) |
text-embedding-3-large | 3072 | Via OpenAI |
text-embedding-3-small | 1536 | Via OpenAI |
curl
bash
curl https://app.qevron.ai/v1/embeddings \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{"model": "veriEmbedding", "input": ["hello world", "merhaba dünya"]}'Python (openai SDK)
python
from openai import OpenAI
import numpy as np
client = OpenAI(api_key="sk-...", base_url="https://app.qevron.ai/v1")
resp = client.embeddings.create(
model="veriEmbedding",
input=["hello world", "merhaba dünya", "qevron is an AI gateway"],
)
vectors = np.array([item.embedding for item in resp.data])
print(vectors.shape) # (3, 1024)Batch
input as an array processes all of them in one pass — 10–100× faster than per-item calls:
python
texts = ["chunk 1", "chunk 2", ..., "chunk 256"]
resp = client.embeddings.create(model="veriEmbedding", input=texts)Batching pattern
When indexing, send 50–100 chunks per request. One huge request (1000+) optimises throughput but risks timeouts.
Cosine similarity
python
from numpy import dot
from numpy.linalg import norm
def cosine(a, b):
return dot(a, b) / (norm(a) * norm(b))
similarity = cosine(vectors[0], vectors[1]) # 0.85+ ⇒ very similarRAG pipeline (typical)
1. Chunk documents (~500 tokens each)
2. Embed each chunk → veriEmbedding
3. Store (chunk_text, vector) in a vector DB (pgvector, qdrant, ...)
4. On user query → embed query → search vector DB for top-K similar chunks
5. (optional) re-rank with verirerag
6. Pass selected chunks as context to verinova-large for the final answerEnd-to-end: RAG walkthrough.
Troubleshooting
- Vectors look identical → input might be empty or too short. Trim whitespace, supply ≥ 5–10 chars.
- Too slow → batch instead of single calls.
- Dimension mismatch → vector DB schema should match the model (1024 for
veriEmbedding). Switching from OpenAI (1536/3072) requires a full re-index.
Next: Rerank · RAG walkthrough