diff options
| author | Adam Malczewski <[email protected]> | 2026-03-24 00:25:03 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-03-24 00:25:03 +0900 |
| commit | e2c88087f3926ec477ea099fd771d1bc9d11d7c5 (patch) | |
| tree | be33c4cdbd1fa67464779e7cd834f002c6cae438 /.rules/docs/ollama/embed.md | |
| parent | dc2fa22c4d279199fb07a205a0c11eb155641f3d (diff) | |
| download | ai-pulse-obsidian-plugin-e2c88087f3926ec477ea099fd771d1bc9d11d7c5.tar.gz ai-pulse-obsidian-plugin-e2c88087f3926ec477ea099fd771d1bc9d11d7c5.zip | |
generate api docs
Diffstat (limited to '.rules/docs/ollama/embed.md')
| -rw-r--r-- | .rules/docs/ollama/embed.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/.rules/docs/ollama/embed.md b/.rules/docs/ollama/embed.md new file mode 100644 index 0000000..9c81ebf --- /dev/null +++ b/.rules/docs/ollama/embed.md @@ -0,0 +1,56 @@ +# Generate embeddings + +`POST /api/embed` — Creates vector embeddings representing the input text. + +**Server:** `http://localhost:11434` + +## Request + +| Field | Type | Required | Description | +|---|---|---|---| +| `model` | string | yes | Model name (e.g. `"embeddinggemma"`) | +| `input` | string \| string[] | yes | Text or array of texts to embed | +| `truncate` | boolean | no | Truncate inputs exceeding context window (default: `true`). If `false`, returns an error. | +| `dimensions` | integer | no | Number of dimensions for the embedding vectors | +| `keep_alive` | string | no | Model keep-alive duration | +| `options` | ModelOptions | no | Runtime options (see generate.md) | + +## Response + +| Field | Type | Description | +|---|---|---| +| `model` | string | Model that produced the embeddings | +| `embeddings` | number[][] | Array of embedding vectors (one per input) | +| `total_duration` | integer | Total time (nanoseconds) | +| `load_duration` | integer | Model load time (nanoseconds) | +| `prompt_eval_count` | integer | Number of input tokens processed | + +## Examples + +### Single input +```bash +curl http://localhost:11434/api/embed -d '{ + "model": "embeddinggemma", + "input": "Why is the sky blue?" +}' +``` + +### Multiple inputs (batch) +```bash +curl http://localhost:11434/api/embed -d '{ + "model": "embeddinggemma", + "input": [ + "Why is the sky blue?", + "Why is the grass green?" + ] +}' +``` + +### Custom dimensions +```bash +curl http://localhost:11434/api/embed -d '{ + "model": "embeddinggemma", + "input": "Generate embeddings for this text", + "dimensions": 128 +}' +``` |
