@@ -38,9 +38,54 @@ uv run --project apps/agent-gateway agent-gateway
3838
3939Gateway endpoints:
4040- ` GET /health `
41+ - ` GET /ready `
4142- ` GET /api/v1/tools `
4243- ` POST /api/v1/chat `
4344
45+ ## Local Self-Hosted Mode (KnowCode + Gateway on your machine)
46+
47+ You can run everything locally with one command:
48+
49+ ``` bash
50+ # Required: export keys in your shell profile or current terminal
51+ export GOOGLE_API_KEY_1=" ..."
52+ export LITELLM_MASTER_KEY=" sk-your-local-master-key"
53+ export LITELLM_API_KEY=" $LITELLM_MASTER_KEY "
54+
55+ # Optional override (default works for local Docker + local KnowCode)
56+ export KNOWCODE_API_BASE_URL=" http://host.docker.internal:8000"
57+
58+ apps/agent-gateway/scripts/local_up.sh
59+ ```
60+
61+ Stop all services:
62+
63+ ``` bash
64+ apps/agent-gateway/scripts/local_down.sh
65+ ```
66+
67+ Notes:
68+ - ` local_up.sh ` starts KnowCode API on ` 0.0.0.0:8000 ` if it is not already running.
69+ - It then starts LiteLLM + gateway via Docker Compose and waits for ` /ready ` .
70+ - Ollama fallback remains configured. If Ollama is installed and running on your host (` :11434 ` ), LiteLLM can route to it.
71+
72+ ## End-to-End Smoke Test
73+
74+ With KnowCode API, LiteLLM, and this gateway running, execute:
75+
76+ ``` bash
77+ uv run --project apps/agent-gateway python scripts/smoke_e2e.py
78+ ```
79+
80+ Optional strict tool set:
81+
82+ ``` bash
83+ uv run --project apps/agent-gateway python scripts/smoke_e2e.py \
84+ --tool-names query_context,get_context \
85+ --min-tool-calls 1 \
86+ --print-json
87+ ```
88+
4489## Docker Run
4590
4691``` bash
@@ -51,6 +96,21 @@ docker compose up --build
5196This starts LiteLLM + the gateway. KnowCode is expected at
5297` http://host.docker.internal:8000 ` by default.
5398
99+ ## Production Notes
100+
101+ - Use ` AGENT_STRICT_ENV_VALIDATION=true ` for non-local environments.
102+ - Keep secrets in a secret manager, not checked-in files.
103+ - Use ` .env.production.example ` as a template only.
104+ - Read ` OPERATIONS.md ` for rollout, readiness probes, monitoring, and rollback.
105+
106+ ## CI Workflows
107+
108+ - ` .github/workflows/agent-gateway-ci.yml `
109+ - Runs Ruff + pytest for ` apps/agent-gateway `
110+ - Validates Docker build
111+ - ` .github/workflows/agent-gateway-smoke.yml `
112+ - Manual post-deploy smoke test against a live gateway URL
113+
54114## Extraction Checklist (To New Repo)
55115
561161 . Copy ` apps/agent-gateway ` into a new repository root.
0 commit comments