add docs for /api/embeddings
This commit is contained in:
parent
7e26a8df31
commit
be889b2f81
1 changed files with 34 additions and 0 deletions
34
docs/api.md
34
docs/api.md
|
@ -8,6 +8,7 @@
|
||||||
- [Copy a model](#copy-a-model)
|
- [Copy a model](#copy-a-model)
|
||||||
- [Delete a model](#delete-a-model)
|
- [Delete a model](#delete-a-model)
|
||||||
- [Pull a model](#pull-a-model)
|
- [Pull a model](#pull-a-model)
|
||||||
|
- [Generate embeddings](#generate-embeddings)
|
||||||
|
|
||||||
## Conventions
|
## Conventions
|
||||||
|
|
||||||
|
@ -220,3 +221,36 @@ curl -X POST http://localhost:11434/api/pull -d '{
|
||||||
"total": 2142590208
|
"total": 2142590208
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Generate Embeddings
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /api/embeddings
|
||||||
|
```
|
||||||
|
|
||||||
|
Generate embeddings from a model
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
- `model`: name of model to generate embeddings from
|
||||||
|
- `prompt`: text to generate embeddings for
|
||||||
|
|
||||||
|
### Request
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -X POST http://localhost:11434/api/embeddings -d '{
|
||||||
|
"model": "llama2:7b",
|
||||||
|
"prompt": "Here is an article about llamas..."
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"embeddings": [
|
||||||
|
0.5670403838157654, 0.009260174818336964, 0.23178744316101074, -0.2916173040866852, -0.8924556970596313,
|
||||||
|
0.8785552978515625, -0.34576427936553955, 0.5742510557174683, -0.04222835972905159, -0.137906014919281
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue