@@ -1026,7 +1026,7 @@ If `stream` is set to `false`, then the response is a single JSON object:
...
@@ -1026,7 +1026,7 @@ If `stream` is set to `false`, then the response is a single JSON object:
## Generate Embeddings
## Generate Embeddings
```shell
```shell
POST /api/embeddings
POST /api/embed
```
```
Generate embeddings from a model
Generate embeddings from a model
...
@@ -1034,10 +1034,11 @@ Generate embeddings from a model
...
@@ -1034,10 +1034,11 @@ Generate embeddings from a model
### Parameters
### Parameters
-`model`: name of model to generate embeddings from
-`model`: name of model to generate embeddings from
-`prompt`: text to generate embeddings for
-`input`: text or list of text to generate embeddings for
Advanced parameters:
Advanced parameters:
-`truncate`: truncates the end of each input to fit within context length. Returns error if `false` and context length is exceeded. Defaults to `true`
-`options`: additional model parameters listed in the documentation for the [Modelfile](./modelfile.md#valid-parameters-and-values) such as `temperature`
-`options`: additional model parameters listed in the documentation for the [Modelfile](./modelfile.md#valid-parameters-and-values) such as `temperature`
-`keep_alive`: controls how long the model will stay loaded into memory following the request (default: `5m`)
-`keep_alive`: controls how long the model will stay loaded into memory following the request (default: `5m`)
@@ -1106,3 +1132,45 @@ A single JSON object will be returned.
...
@@ -1106,3 +1132,45 @@ A single JSON object will be returned.
]
]
}
}
```
```
## Generate Embedding
> Note: this endpoint has been superseded by `/api/embed`
```shell
POST /api/embeddings
```
Generate embeddings from a model
### Parameters
-`model`: name of model to generate embeddings from
-`prompt`: text to generate embeddings for
Advanced parameters:
-`options`: additional model parameters listed in the documentation for the [Modelfile](./modelfile.md#valid-parameters-and-values) such as `temperature`
-`keep_alive`: controls how long the model will stay loaded into memory following the request (default: `5m`)