fix: configurable OLLAMA_URL for Docker container

Ollama runs on host, container needs host.docker.internal mapping.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
denshooter
2026-02-18 13:38:12 +01:00
parent 70ac6c132f
commit c242976b41
3 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -65,7 +65,8 @@ JSON:`
const controller = new AbortController()
setTimeout(() => controller.abort(), 15000)
const res = await fetch('http://localhost:11434/api/generate', {
const ollamaUrl = process.env.OLLAMA_URL || 'http://localhost:11434'
const res = await fetch(`${ollamaUrl}/api/generate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
signal: controller.signal,
+2 -1
View File
@@ -15,7 +15,8 @@ export async function POST(req: NextRequest) {
}
// Ollama API aufrufen
const ollamaResponse = await fetch('http://localhost:11434/api/generate', {
const ollamaUrl = process.env.OLLAMA_URL || 'http://localhost:11434'
const ollamaResponse = await fetch(`${ollamaUrl}/api/generate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({