Ollama · Embeddings
Generates embeddings using the Ollama embed API shape.#
/api/embedOllama-compatible embeddings endpoint. Accepts a single string or an array of strings and returns one vector per input. Over-long inputs are chunked and mean-pooled by the runtime, so the truncate flag is accepted and ignored.
Reference: https://docs.ollama.com/api#generate-embeddings
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
model | string | The embedding model identifier. If not specified, the server's default embedding model is used. |
input | object | Text to embed: a string or an array of strings. |
truncate | boolean | Whether over-long inputs are reduced to the model's context window. This server chunks and mean-pools over-long inputs, so the flag is accepted and ignored. |
options | Runtime options. Accepted for wire compatibility. | |
keep_alive | one of object · |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 400 | Bad Request | |
| 404 | Not Found | |
| 500 | application/json | Internal Server Error |
curl -X POST "$LMKIT_ONE_URL/api/embed" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"input": {},
"truncate": false,
"options": {
"num_ctx": "string",
"num_predict": "string",
"temperature": "string",
"top_p": "string"
}
}'Generates one embedding using the legacy Ollama embeddings API shape.#
/api/embeddingsLegacy Ollama embeddings endpoint, superseded by /api/embed but still used by older clients. Takes a single prompt and returns a single vector. An empty prompt returns an empty vector, matching Ollama.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
model | string | The embedding model identifier. If not specified, the server's default embedding model is used. |
prompt | string | Text to embed. |
options | Runtime options. Accepted for wire compatibility. | |
keep_alive | one of object · |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found | |
| 500 | application/json | Internal Server Error |
curl -X POST "$LMKIT_ONE_URL/api/embeddings" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"prompt": "string",
"options": {
"num_ctx": "string",
"num_predict": "string",
"temperature": "string",
"top_p": "string"
}
}'