Skip to main content
SGL Grid serves embedding models alongside chat, reasoning and coding models. An embedding turns a piece of text into a fixed-length vector of floats you can store in a vector database and compare with cosine similarity — the backbone of semantic search and retrieval-augmented generation (RAG). Embeddings are a distinct modality from chat: they use the OpenAI-compatible /v1/embeddings endpoint (not /v1/chat/completions), return a vector rather than text, and are billed on input tokens only (there is no generation).

Endpoint

Request body (OpenAI-compatible): The response matches OpenAI’s shape:
Vectors are returned in the same order as input and are L2-normalized, so a plain dot product equals cosine similarity.

Model catalog

All models are tiny, CPU-friendly BERT encoders — great even on modest hardware. List what’s live right now (embeddings appear once at least one node serves them):

Quickstart

Matryoshka dimensions

nomic-embed-text-v1.5 and mxbai-embed-large-v1 are Matryoshka models — you can ask for a shorter vector to save storage and speed up search, at a small recall cost. The server truncates and re-normalizes:

Query vs document

Some models score asymmetric retrieval better when you tell them whether a text is a search query or a stored document. Pass input_type (Singularity SDK / raw API):

Billing

Embeddings are billed on input tokens only at the model’s per-token rate — there is no output/generation cost. Pay with credits (API key) or per-call with an x402 wallet, exactly like chat. A timed-out or failed request is never charged.

A minimal RAG loop

  1. Index: embed your documents and store (id, vector, text) in a vector DB (pgvector, Pinecone, …).
  2. Retrieve: embed the user’s question, find the nearest vectors (cosine).
  3. Generate: pass the top matches as context to a chat model on the grid.
The embedding model is the search index step — not the conversation. See the API guide for the chat call.
Run an embedding model yourself and earn from other people’s search/RAG apps — see Provide Compute.