fix: default Ollama endpoints to localhost instead of 192.168.0.240 (#98)

The hardcoded 192.168.0.240 IP was a developer-specific LAN address
that breaks out-of-the-box for anyone running Ollama locally or via
WSL2 on Windows. Switch every default and docstring reference to
localhost so the project works without manual configuration.

Files changed:
- coach/config.py: LLM_URL and DECK_GEN_BASE_URL defaults
- ui/simulator.html: API endpoint input value and placeholder
- lab_api.py: remove LAN IP from default CORS origins
- routes/coach.py: warning message text
- src/commander_ai_lab/sim/deepseek_brain.py: docstrings
- src/commander_ai_lab/sim/deepseek_engine.py: docstring example
- src/commander_ai_lab/sim/validator_brain.py: docstring example

Co-authored-by: Claude Code <noreply@anthropic.com>
This commit is contained in:
KoalaTrapLordandClaude Code authored and GitHub committed 2026-03-23 21:03:17 -04:00
1 parent 56e5bff496
commit f0dfb41f2f
7 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ The LLM receives a structured game-state snapshot and returns a JSON
action describing what to do this turn (play land, cast spell, attack,
hold/pass, use removal, use board wipe, cast ramp, cast commander).
Default target: GPT-OSS 20B (Q4_K_M) via Ollama at 192.168.0.240:11434
Default target: GPT-OSS 20B (Q4_K_M) via Ollama at localhost:11434
ollama run deepseek-r1:8b
Also supports:
@@ -64,7 +64,7 @@ class DeepSeekConfig:
)
Example — Ollama (default)::
config = DeepSeekConfig() # points at 192.168.0.240:11434 / deepseek-r1:8b
config = DeepSeekConfig() # points at localhost:11434 / deepseek-r1:8b
"""
# API endpoint — Ollama OpenAI-compatible base (NO /v1 suffix)
+1 -1
View File
@@ -23,7 +23,7 @@ Usage::
from commander_ai_lab.sim.deepseek_engine import DeepSeekGameEngine
from commander_ai_lab.sim.deepseek_brain import DeepSeekBrain, DeepSeekConfig
brain = DeepSeekBrain(DeepSeekConfig(api_base="http://192.168.0.240:11434"))
brain = DeepSeekBrain(DeepSeekConfig(api_base="http://localhost:11434"))
brain.check_connection()
engine = DeepSeekGameEngine(brain=brain, ai_player_index=1)
result = engine.run(deck_a, deck_b, name_a="My Deck", name_b="DeepSeek AI")
+1 -1
View File
@@ -50,7 +50,7 @@ class ValidatorConfig:
Example -- LM Studio::
cfg = ValidatorConfig(
api_base="http://192.168.0.240:1234",
api_base="http://localhost:1234",
model="deepseek-r1-distill-qwen-14b",
)
"""