host.docker.internal not working in wsl docker when coming from host. window shost ip is working. so removed the part and modified doc

This commit is contained in:
Robert Herzog 2025-10-26 10:47:47 +01:00
parent 15a79735e6
commit cd68aab883
2 changed files with 3 additions and 6 deletions

View File

@ -413,8 +413,8 @@ python3 -m venv cai_env
# Install the package from the local directory
source cai_env/bin/activate && pip install cai-framework
# Generate a .env file and set up with defaults. If Ollama runs on your windows host, wsl needs to use host.docker.internal for it to become reachable
echo -e 'OPENAI_API_KEY="sk-1234"\nANTHROPIC_API_KEY=""\nOLLAMA=""\nOLLAMA_API_BASE="http://host.docker.internal:11434"\nPROMPT_TOOLKIT_NO_CPR=1\nCAI_STREAM=false' > .env
# Generate a .env file and set up with defaults. If Ollama runs on your windows host, wsl needs to use your host IP for it to become reachable
echo -e 'OPENAI_API_KEY="sk-1234"\nANTHROPIC_API_KEY=""\nOLLAMA=""\nOLLAMA_API_BASE="http://Your.Host.Ip.Here:11434"\nPROMPT_TOOLKIT_NO_CPR=1\nCAI_STREAM=false' > .env
# Launch CAI
cai # first launch it can take up to 30 seconds

View File

@ -23,10 +23,7 @@ services:
# Optional: Docker socket if cai should use docker should it though?
# - /var/run/docker.sock:/var/run/docker.sock
# OPTIONAL WSL: host.docker.internal Access if ollama runs on windows host instead of inside wsl.
# extra_hosts:
# - "host.docker.internal:host-gateway"
# Env Vars (Fallback, .env wins if present)
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY:-sk-1234}