Capabilities
Embeddings
An embedding is a list of numbers that captures the meaning of a piece of text. Texts that mean similar things land near each other in vector space, which is what makes semantic search, retrieval-augmented generation (RAG), deduplication, clustering, and classification work.
Embed some text
Pass a single string or an array of strings as input. You
get back one vector per input, in the same order. Embed your documents
once and store the vectors; at query time, embed the query and find the
nearest stored vectors.
from pendra import Pendra
client = Pendra()
result = client.embeddings.create(
model="nomic-embed-text",
input=["the quick brown fox", "jumps over the lazy dog"],
)
for item in result.data:
print(item.embedding) [ 0.0131, -0.0442, 0.0921, … ] # "the quick brown fox"
[ 0.0204, -0.0118, 0.0815, … ] # "jumps over the lazy dog" One vector per input — two strings in, two vectors out, in the same order. Each is truncated here (…); a full vector has hundreds or thousands of dimensions, depending on the model.
Choosing a model
Pendra ships several embedding models — Qwen3-Embedding
(0.6B/4B/8B), EmbeddingGemma, BGE-M3, and
nomic-embed-text among them. Dimensionality and similarity
behaviour differ per model, so pick one and embed your whole corpus with
it consistently. Browse the options at
/models?type=embedding.
Batching
Embedding many strings at once is far faster than one request each. Send
a few hundred per request rather than one huge batch — a single request
should complete quickly (it can run up to ~30 minutes before timing out).
For big wire payloads, set encoding_format: "base64" to shrink
the response.