From 88c18ee69ef1179de0fde319f0aa4cef089bbc84 Mon Sep 17 00:00:00 2001 From: claude-bot Date: Thu, 30 Apr 2026 18:11:31 +0900 Subject: [PATCH] Default Ollama URL to 127.0.0.1 --- .env.example | 2 +- README.md | 2 ++ src/config.ts | 2 +- src/services/ollama-llm.ts | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 44979bf..7fc2eeb 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ DISCORD_BOT_TOKEN= DISCORD_APPLICATION_ID= DISCORD_COMMAND_GUILD_ID= -OLLAMA_BASE_URL=http://localhost:11434 +OLLAMA_BASE_URL=http://127.0.0.1:11434 OLLAMA_MODEL=qwen3:0.6b OLLAMA_KEEP_ALIVE=5m OLLAMA_NUM_CTX=4096 diff --git a/README.md b/README.md index 687885c..f47d969 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ LOCAL_AI_PYTHON=python LOCAL_AI_PYTHON=py -3 ``` +Windows에서 Ollama는 `localhost` 대신 `127.0.0.1`를 쓰는 편이 안전합니다. + 그다음 로컬 장치 확인: ```bash diff --git a/src/config.ts b/src/config.ts index 4e20dfb..83115d9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -15,7 +15,7 @@ const envSchema = z.object({ DISCORD_BOT_TOKEN: emptyToUndefined, DISCORD_APPLICATION_ID: emptyToUndefined, DISCORD_COMMAND_GUILD_ID: emptyToUndefined, - OLLAMA_BASE_URL: z.string().min(1).default("http://localhost:11434"), + OLLAMA_BASE_URL: z.string().min(1).default("http://127.0.0.1:11434"), OLLAMA_MODEL: z.string().min(1).default("qwen3:0.6b"), OLLAMA_KEEP_ALIVE: z.string().min(1).default("5m"), OLLAMA_NUM_CTX: z.coerce.number().int().min(512).max(32768).default(4096), diff --git a/src/services/ollama-llm.ts b/src/services/ollama-llm.ts index a93ad2b..869247b 100644 --- a/src/services/ollama-llm.ts +++ b/src/services/ollama-llm.ts @@ -54,7 +54,7 @@ export class OllamaLlmService implements LlmService { response = await fetch(url); } catch { throw new Error( - `Ollama 서버에 연결할 수 없습니다. ${this.config.OLLAMA_BASE_URL} 확인 후 Ollama 앱 또는 \`ollama serve\` 를 실행하고 \`ollama pull ${this.config.OLLAMA_MODEL}\` 까지 끝내 주세요.`, + `Ollama 서버에 연결할 수 없습니다. ${this.config.OLLAMA_BASE_URL} 확인 후 Ollama 앱이 실행 중인지 확인해 주세요. Windows에서는 \`localhost\` 대신 \`http://127.0.0.1:11434\` 를 권장합니다. 모델이 없으면 \`ollama pull ${this.config.OLLAMA_MODEL}\` 를 먼저 실행하세요.`, ); } @@ -110,7 +110,7 @@ export class OllamaLlmService implements LlmService { }); } catch { throw new Error( - `Ollama 서버에 연결할 수 없습니다. ${this.config.OLLAMA_BASE_URL} 확인 후 Ollama 앱 또는 \`ollama serve\` 를 실행해 주세요.`, + `Ollama 서버에 연결할 수 없습니다. ${this.config.OLLAMA_BASE_URL} 확인 후 Ollama 앱이 실행 중인지 확인해 주세요. Windows에서는 \`localhost\` 대신 \`http://127.0.0.1:11434\` 를 권장합니다.`, ); }