Skip to content

LV015-Endpoints

来看一下ollama的api端口。

一、Ollama 接口端点

端点请求API端点参数说明
生成响应POST
http://localhost:11434/api/generate
https://ollama.com/api/generate
Generate a response - Ollama
生成聊天消息POST
http://localhost:11434/api/chat
https://ollama.com/api/chat
Generate a chat message - Ollama
生成嵌入POST
http://localhost:11434/api/embed
https://ollama.com/api/embed
Generate embeddings - Ollama
列出模型GET
http://localhost:11434/api/tags
https://ollama.com/api/tags
List models - Ollama
列出运行中的模型GET
http://localhost:11434/api/ps
https://ollama.com/api/ps
List running models - Ollama
显示模型详情POST
http://localhost:11434/api/show
https://ollama.com/api/show
Show model details - Ollama
获取Ollama版本GET
http://localhost:11434/api/version
https://ollama.com/api/version
Get version - Ollama
## 二、OpenAI兼容端口
端点Supported featuresSupported request fields
/v1/chat/completions• 聊天补全
• Streaming 流式传输
• JSON模式
• 可复现的输出
• 愿景
• 工具
请求字段
/v1/completions• 补全
• Streaming 流式传输
• JSON模式
• 可复现的输出
请求字段
/v1/embeddings• 词嵌入请求字段