Fix AI prompt URL: use /ollama/v1/chat/completions for Open WebUI
The server at ai.binarygnome.com is Open WebUI, not a bare Ollama instance. Open WebUI proxies Ollama at /ollama/v1/... rather than /v1/... Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6f12efd3fb
commit
c5b7d7f774
@ -176,7 +176,7 @@ function nextFallback() {
|
||||
|
||||
// ── Shared AI call — uses the OpenAI-compatible chat completions API ─────
|
||||
async function callOllama() {
|
||||
const url = `${OLLAMA_URL}/v1/chat/completions`
|
||||
const url = `${OLLAMA_URL}/ollama/v1/chat/completions`
|
||||
console.log(`[prompts] calling AI url=${url} model=${OLLAMA_MODEL}`)
|
||||
|
||||
const headers = { 'Content-Type': 'application/json' }
|
||||
@ -212,7 +212,7 @@ const router = Router()
|
||||
|
||||
// Debug endpoint — no auth needed, only exposes connection status
|
||||
router.get('/test', async (req, res) => {
|
||||
const result = { url: `${OLLAMA_URL}/api/generate`, model: OLLAMA_MODEL }
|
||||
const result = { url: `${OLLAMA_URL}/ollama/v1/chat/completions`, model: OLLAMA_MODEL }
|
||||
try {
|
||||
result.prompt = await callOllama()
|
||||
result.status = 'ok'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user