feat(db): 添加 Ollama本地离线模型支持

- 在 builtin_providers.json 中添加 Ollama 提供商配置
- 修改 OpenAI_compatible_provider.py,优化与 Ollama 的兼容性
This commit is contained in:
黄建武
2025-05-14 15:28:57 +08:00
parent 3862c657b7
commit aeae3410a0
2 changed files with 8 additions and 1 deletions

View File

@@ -46,5 +46,13 @@
"logo": "Groq",
"api_key": "",
"base_url": "https://api.groq.com/openai/v1"
},
{
"id": "ollama",
"name": "ollama",
"type": "built-in",
"logo": "Ollama",
"api_key": "",
"base_url": "http://127.0.0.1:11434/v1"
}
]

View File

@@ -16,7 +16,6 @@ class OpenAICompatibleProvider:
print(api_key)
try:
client = OpenAI(api_key=api_key, base_url=base_url)
client.models.list()
return True
except Exception as e: