Skip to content

Commit 00b0ec5

Browse files
committed
Refactor API key validation in main.py and update docker-compose.yml to set LLM_API_KEY as an empty variable for clarity
1 parent 99548e3 commit 00b0ec5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
# Get API key from environment variable (make optional)
2525
api_key = os.getenv("LLM_API_KEY", "")
2626
# Only validate if not using local setup
27-
if not api_key and not os.getenv("LLM_API_BASE", "").startswith("http://localhost"):
27+
if not api_key and not (os.getenv("LLM_API_BASE", "").startswith("http://localhost") or
28+
os.getenv("LLM_API_BASE", "").startswith("http://host.docker.internal")):
2829
raise ValueError("LLM_API_KEY environment variable not set")
2930

3031
# Get embedding size from environment variable

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ services:
44
ports:
55
- "8000:8000"
66
environment:
7-
- LLM_API_KEY=${LLM_API_KEY}
87
- LLM_API_BASE=http://host.docker.internal:8080/v1
98
- LLM_MODEL=Qwen2.5-Coder-3B-Instruct-Q5_K_M
109
- LLM_EMBED_MODEL=local-embed
1110
- LLM_EMBED_SIZE=768
11+
- LLM_API_KEY=
12+
- SKIP_VECTOR_SEARCH=true
1213
- QDRANT_HOST=qdrant
1314
- QDRANT_PORT=6333
1415
command: uvicorn app.main:app --host 0.0.0.0 --port 8000

0 commit comments

Comments
 (0)