Ollama adds /v1/models and /v1/completions OpenAI compatible APIs
Posted by sammcj@reddit | LocalLLaMA | View on Reddit | 6 comments
- https://github.com/ollama/ollama/pull/5209
- https://github.com/ollama/ollama/pull/2476
Both merged into main today, if you're using their pre-built binaries you'll need to wait for the next release.
The models endpoint is nice as you query your models via the OpenAI compatible API and libraries, meaning that tools that only support OpenAI servers can return a list of models:
`curl http://localhost:11434/v1/models|jq`
```json
{
"object": "list",
"data": [
{
{
"id": "phi3-128k:Q8_0",
"object": "model",
"created": 1714120125,
"owned_by": "library"
},
{
"id": "ollama/sfr-embedding-mistral:q4_k_m",
"object": "model",
"created": 1713239040,
"owned_by": "ollama"
}
]
}
```
And you individual models to get some basic information:
`curl http://localhost:11434/v1/models/phi3-128k:Q8_0|jq`
```json
{
"id": "phi3-128k:Q8_0",
"object": "model",
"created": 1714120125,
"owned_by": "library"
}
```
6 Comments
kryptkpr@reddit
Everlier@reddit
sammcj@reddit (OP)
Everlier@reddit
----Val----@reddit
sammcj@reddit (OP)