LM-Kit OneDocs2026.8.10lm-kit.com
API Compatibility

Ollama · Embeddings

Generates embeddings using the Ollama embed API shape.#

POST/api/embed

Ollama-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 ·

PropertyTypeDescription
modelstring

The embedding model identifier. If not specified, the server's default embedding model is used.

inputobject

Text to embed: a string or an array of strings.

truncateboolean

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_aliveone of object ·

Responses

StatusTypeDescription
200

OK

400

Bad Request

404

Not Found

500application/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.#

POST/api/embeddings

Legacy 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 ·

PropertyTypeDescription
modelstring

The embedding model identifier. If not specified, the server's default embedding model is used.

promptstring

Text to embed.

options

Runtime options. Accepted for wire compatibility.

keep_aliveone of object ·

Responses

StatusTypeDescription
200

OK

404

Not Found

500application/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"
  }
}'