Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/agent-toolkit-components/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Steps marked **(changes the cluster)** in the references create or change object
| Symptom | Cause | Fix |
|---|---|---|
| Connection reset to any toolkit service | Namespace not in the mesh, or not allowed by LiteLLM | `references/namespace-onboarding.md` |
| LiteLLM 400, 401, 403 or 429 about the key | Read `error.type` in the body: `budget_exceeded`, `expired_key`, `key_model_access_denied` or `auth_error`. The status code for each differs between LiteLLM versions. | Check the key with `/key/info`; `references/litellm.md` |
| LiteLLM 400, 401, 403 or 429 about the key | Read `error.type` in the body: `budget_exceeded`, `expired_key`, `key_model_access_denied`, `auth_error` or `token_not_found_in_db`. The status code for each differs between LiteLLM versions. | Check the key with `/key/info`; `references/litellm.md` |
| LiteLLM 500 `Blocked by the content-safety guardrail: ...` | Guardrail decision (or the guard is down) | Read the reason; agent-toolkit-troubleshoot skill, GRD-1 |
| `WRONGPASS invalid username-password pair` | An old password (Redis was reinstalled), or a client that sends an empty username | Use the current `REDIS_URL` |
| `expected 1536 dimensions, not N` | The pre-created pgvector tables are 1536-d | Create a table with your dimension |
Expand Down
12 changes: 6 additions & 6 deletions .agents/skills/agent-toolkit-components/references/litellm.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ LiteLLM is the OpenAI-compatible gateway in front of every model. It provides vi
| Outside the cluster, `routing_mode: path` (main track) | `https://<base_domain_name>/litellm/v1` |
| A laptop without DNS | `kubectl port-forward -n litellm svc/litellm 4000:4000`, then `http://localhost:4000/v1` |

The non-secret config map `litellm-credentials` in `litellm` names this install's API host (`api_url` or `hostname`, depending on the version) and admin UI host (`ui_url`; add `/ui/` to open it): `kubectl get cm litellm-credentials -n litellm -o jsonpath='{.data}'`.
The non-secret config map `litellm-credentials` in `litellm` names this install's API host (`api_url` or `hostname`, depending on the version) and admin UI (`ui_url`, the full address): `kubectl get cm litellm-credentials -n litellm -o jsonpath='{.data}'`.

Path mode with the toolkit default `litellm_public_paths: []` may publish no API route at all on the main track (untested). If `https://<base_domain_name>/litellm/v1/models` redirects to a sign-in page, set `litellm_public_paths` to the API paths (agent-toolkit-configuration skill).
Path mode with the toolkit default `litellm_public_paths: []` publishes no API route at all on the main track: the gateway gets one route per listed path. If `https://<base_domain_name>/litellm/v1/models` redirects to a sign-in page, set `litellm_public_paths` to the API paths (agent-toolkit-configuration skill).

From outside, trust the gateway CA when TLS is self-signed: `env/<env>/logs/toolkit-manager-ca.crt` under the Toolkit Manager root. Pass it to curl with `--cacert`, or to Python with `REQUESTS_CA_BUNDLE` / `SSL_CERT_FILE`.

Expand Down Expand Up @@ -66,9 +66,9 @@ More models: `./model-manager deploy <name>` from the Toolkit Manager root (cata
The OpenAI SDK, LangChain `ChatOpenAI`, CrewAI and LangGraph all read:

```bash
OPENAI_BASE_URL=http://litellm.litellm.svc.cluster.local:4000/v1
OPENAI_API_KEY=<virtual key>
NO_PROXY=.svc,.cluster.local,localhost,127.0.0.1 # when the pod has proxy variables
export OPENAI_BASE_URL=http://litellm.litellm.svc.cluster.local:4000/v1
export OPENAI_API_KEY=<virtual key>
export NO_PROXY=.svc,.cluster.local,localhost,127.0.0.1 # when the pod has proxy variables
```

- Set the client timeout to at least 180 s. CPU inference under load is slow.
Expand All @@ -85,7 +85,7 @@ Classify a LiteLLM error by `error.type` and `error.message` in the JSON body, n
| `budget_exceeded` | The key's budget is spent |
| `expired_key` | The key has expired |
| `key_model_access_denied` (or `team_model_access_denied`) | The key may not use this model |
| `auth_error`, or no key | Missing or invalid key |
| `auth_error` (no key sent) or `token_not_found_in_db` (unknown or deleted key) | Missing or invalid key |
| `Invalid model name passed in model=...` (400) | Not a registered name; check `/v1/models` |
| 500 with the guardrail prefix | Guardrail decision |
| 429 with no LiteLLM error body | The external gateway's rate limit (600 a minute per client IP) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Both services are inside the Istio ambient mesh with STRICT mTLS. A client pod m

## Redis Stack: short-term memory

Use it for session and chat state, LangGraph checkpoints, semantic caches and RediSearch vector indexes. It is Redis Stack 7.4 with RediSearch loaded: one replica, password required, no TLS (the mesh encrypts traffic).
Use it for session and chat state, LangGraph checkpoints, semantic caches and RediSearch vector indexes. It is open-source Redis 8.10.3 with search and JSON built in (toolkit revisions before #43, including the ones Toolkit Manager `release-1.2` and `release-2.0` pin, install Redis Stack 7.4): one replica, password required, no TLS (the mesh encrypts traffic).

| | Value |
|---|---|
Expand All @@ -15,7 +15,7 @@ Use it for session and chat state, LangGraph checkpoints, semantic caches and Re
| Storage | 10Gi PVC `db-redis-stack-server-0` (`redis_stack_persistence_size`, fixed after the first install) |

```bash
REDIS_URL=$(kubectl get secret redis-stack-server-credentials -n redis -o jsonpath='{.data.REDIS_URL}' | base64 -d) # holds the password; do not echo
export REDIS_URL=$(kubectl get secret redis-stack-server-credentials -n redis -o jsonpath='{.data.REDIS_URL}' | base64 -d) # holds the password; do not echo
```

```python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Access model (default): single admin, and the client certificate is the only che
kubectl port-forward -n openshell-system svc/openshell 8080:8080 &
# Otherwise the CLI hangs behind a proxy. Keep the existing entries: kubectl still needs them.
export NO_PROXY="127.0.0.1,localhost${NO_PROXY:+,$NO_PROXY}" no_proxy="127.0.0.1,localhost${no_proxy:+,$no_proxy}"
dir="${XDG_CONFIG_HOME:-$HOME/.config}/openshell/gateways/eat/mtls"; mkdir -p "$dir"
dir="${XDG_CONFIG_HOME:-$HOME/.config}/openshell/gateways/eat/mtls"; mkdir -p "$dir" && chmod 700 "$dir"
for k in ca.crt tls.crt tls.key; do
kubectl get secret openshell-client-tls -n openshell-system -o jsonpath="{.data.${k//./\\.}}" | base64 -d > "$dir/$k"
kubectl get secret openshell-client-tls -n openshell-system -o go-template="{{index .data \"$k\"}}" | base64 -d > "$dir/$k"
done
chmod 600 "$dir"/*
openshell gateway add https://127.0.0.1:8080 --local --name eat
Expand Down Expand Up @@ -74,4 +74,4 @@ kubectl get pods,networkpolicy -n openshell-sandboxes
kubectl logs -n openshell-system openshell-0 | sed 's/\x1b\[[0-9;]*m//g'
```

The gateway log repeats `WARN ... Compute driver watch stream errored ... too old: Expired`. It is harmless.
The gateway log repeats `WARN ... Kubernetes watcher stream error; waiting for kube-runtime recovery ... too old ... Expired` (0.0.116: `Compute driver watch stream errored`). It is harmless.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ If traces stop appearing, check Langfuse's ClickHouse pod for restarts: `kubectl
| OTLP HTTP | `http://opentelemetry-collector.monitoring.svc.cluster.local:4318` |

```bash
OTEL_EXPORTER_OTLP_ENDPOINT=http://opentelemetry-collector.monitoring.svc.cluster.local:4318
OTEL_SERVICE_NAME=<your-agent>
export OTEL_EXPORTER_OTLP_ENDPOINT=http://opentelemetry-collector.monitoring.svc.cluster.local:4318
export OTEL_SERVICE_NAME=<your-agent>
```

The collector feeds Tempo, viewed in Grafana (`https://grafana.<base_domain_name>`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ finally:
- The kubelet rotates the token file. Read it again for each new client; a token read once at start-up expires.
- The pod's ServiceAccount token must be mounted (do not set `automountServiceAccountToken: false`). The same ServiceAccount needs the Role above.
- `warmpool="kata-pool"` runs the same code in a Kata microVM. A comment in `charts/agent-sandbox/kata-templates.yaml` shows `create_sandbox(template=...)`, which is wrong for SDK 1.0.10: the argument is `warmpool`.
- `SandboxClient()` with no config uses a `kubectl port-forward` tunnel. That is for laptops, not pods.
- `SandboxClient()` with no config opens its own `kubectl port-forward` tunnel, but cannot send a token, so this router answers 401. From a laptop, run `kubectl port-forward -n agent-sandbox-system svc/sandbox-router-svc 8080:8080` and use `SandboxDirectConnectionConfig(api_url="http://127.0.0.1:8080", extra_headers={"Authorization": f"Bearer {token}"})` with a token from `kubectl create token default -n agent-sandbox-system`.
- `SandboxInClusterConnectionConfig` connects straight to the sandbox pod and times out: sandbox pods accept traffic only from the router.
- The Python runtime image serves `POST /execute {"command": "..."}` on port 8888 and returns `stdout`, `stderr` and `exit_code`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ All keys below go in `env/<env>/config.agent-toolkit.yaml` unless the table says
| `auth_type` | `litellm_vkey` | API access mode. `litellm_vkey` = LiteLLM with virtual keys (what the toolkit needs). `jwt` = Keycloak tokens straight to the AI gateway, with no LiteLLM, guardrail, hybrid router, Langfuse or OpenShell provider. Main track only; see "Auth switch" in `../SKILL.md`. |
| `guardrails_enabled` | on with LiteLLM | Content-safety guard on every LiteLLM request. Fail-closed, and adds the `qwen3guard` CPU model. Set `false` to save CPU or for latency tests. How to apply on or off differs by track; see `../SKILL.md` section 4. |
| `hybrid_router_enabled` | `true` | Publishes the LiteLLM model `hybrid-router`. Changes on an installed LiteLLM need `-- -e litellm_reconcile=true`. |
| `litellm_public_paths` | `[]` | Paths published on `litellm.<base_domain_name>`. `[]` = every path, including the key-management API (LiteLLM still asks for a key). To restrict it, list API paths such as `/v1/chat/completions`, `/v1/embeddings` and `/v1/models`. Main track: the toolkit's `[]` replaces the inference layer's API-only default, and the admin UI is on `litellm-ui.<base_domain_name>` regardless. Release track: a non-empty list also unpublishes the UI. With `routing_mode: path` (main track), always set the list explicitly. |
| `litellm_public_paths` | `[]` | Paths published on `litellm.<base_domain_name>`. With subdomains, `[]` = every path, including the key-management API (LiteLLM still asks for a key). To restrict it, list API paths such as `/v1/chat/completions`, `/v1/embeddings` and `/v1/models`. Main track: the toolkit's `[]` replaces the inference layer's API-only default, and the admin UI is on `litellm-ui.<base_domain_name>` regardless. Release track: a non-empty list also unpublishes the UI. With `routing_mode: path` (main track), `[]` publishes no API route at all, so always set the list explicitly. |
| `llm_services_autodeploy_models` | `["qwen2-5-coder-14b"]` | Models deployed by `install`. They are **required**: if one fails, the install fails. `[]` installs no chat model. The first entry is also the hybrid-router and semantic-router default. Names must exist in `env/<env>/models.yaml`. |
| `vllm_sr_dashboard_enabled` | `true` | vLLM Semantic Router dashboard. Matters only with `vllm_sr_enabled: true` in `config.inference.yaml`. |
| `vllm_sr_litellm_model_name` | `vllm-sr/auto` | The model name clients use for semantic routing. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Observed in validation runs (single node, behind a proxy); expect variation with
3. The read-only health checks in the agent-toolkit-troubleshoot skill (step 1), for what `validate` does not cover: restarting pods, mesh labels, the gateway address and client name resolution.
4. Client access: map these names under `.<base_domain_name>` to the gateway IP:
- always: `litellm`, `langfuse`, `grafana`
- main track: also `litellm-ui` and `keycloak`
- main track: also `litellm-ui`, `keycloak` and `headlamp`
- with KubeRay: `ray`; with the semantic router: `vllm-sr`

`kubectl get httproute -A -o jsonpath='{range .items[*]}{.spec.hostnames}{"\n"}{end}' | sort -u` lists every published host. Trust `env/<env>/logs/toolkit-manager-ca.crt`. See the agent-toolkit-troubleshoot skill (`references/network.md`) for the exact commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Check every row before the first install. Commands only read. Run them on each n
|---|---|---|
| Docker | `systemctl is-active docker` | Kubespray removes a running Docker, and its reset wipes the image store Docker uses. Do not install on a Docker host, or `docker save` and stop Docker first. |
| Ports 80 and 443 | `ss -ltn '( sport = :80 or sport = :443 )'` | The gateway's LoadBalancer IP is the node IP. |
| inotify limit | `sysctl fs.inotify.max_user_instances` | Kubespray sets 8192 (and `max_user_watches` 1048576) on every node. Nothing to do. |
| inotify limit | `sysctl fs.inotify.max_user_instances` | Expected 8192: Kubespray sets it (and `max_user_watches` 1048576) on every node. A lower value means an older Toolkit Manager checkout or an override (agent-toolkit-troubleshoot skill, INS-25). |
| Time sync | `timedatectl status \| grep synchronized` | Every node, for multi-node |
| Existing Kubernetes leftovers | `ls /etc/kubernetes /var/lib/kubelet 2>/dev/null` | Leftovers from a failed install break the next one. `teardown kubernetes` cleans them, but it runs a Kubespray reset on every inventory node: ask the user first. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Install output lines like `FAILED - RETRYING: ... Wait for ... (N retries left)`
- **Fix:** add the label to the template's pod metadata, as both shipped templates have **(changes the cluster)**.

### SBX-9 `kubectl get --raw /api/v1/namespaces/agent-sandbox-system/services/sandbox-router-svc:8080/proxy/...` fails with `ServiceUnavailable`
- **Why:** the namespace is meshed; the API server proxy cannot speak mTLS to it.
- **Why:** the namespace is meshed, and the API server may not reach it through the mesh (it works on some installs).
- **Fix:** use `kubectl port-forward -n agent-sandbox-system svc/sandbox-router-svc 8080:8080`.

## Kata Containers (infrastructure component, switches in `global_config.yaml`)
Expand All @@ -73,7 +73,7 @@ Install output lines like `FAILED - RETRYING: ... Wait for ... (N retries left)`

### KATA-3 `FailedCreatePodSandBox ... snapshotter devmapper was not found` on a worker (kata-fc)
- **Why:** the node's tasks ran on the installer host instead, because the node has no `ansible_connection` in the inventory. The worker never got the devmapper thin-pool.
- **Check:** `grep -n ansible_connection env/<env>/inventory/hosts.yaml`. On the node: `sudo ctr plugins ls | grep devmapper` (should be `ok`).
- **Check:** `grep -n ansible_connection env/<env>/inventory/hosts.yaml`. On the node: `sudo <root>/.kubespray/bin/ctr plugins ls | grep devmapper` on a single-node install, or `sudo /usr/local/bin/ctr plugins ls | grep devmapper` on the nodes of a multi-node one (should be `ok`; `ctr` is not on root's PATH).
- **Fix:** see INS-21 in `install.md` (an older main-track checkout, or a hand-written inventory), then re-run the install **(changes the cluster)**.

### KATA-4 After `teardown kubernetes`, the next Kata install fails on leftovers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Classify by the JSON body (`error.type`, `error.message`) first. Status codes fo

| Status | Body or situation | Meaning | Entry |
|---|---|---|---|
| 400, 401, 403 or 429 | `error.type` `budget_exceeded`, `expired_key`, `key_model_access_denied`, `team_model_access_denied` or `auth_error` | A key problem: over budget, expired, model not allowed, or a missing or invalid key | LLM-1 |
| 400, 401, 403 or 429 | `error.type` `budget_exceeded`, `expired_key`, `key_model_access_denied`, `team_model_access_denied`, `auth_error` or `token_not_found_in_db` | A key problem: over budget, expired, model not allowed, or a missing or invalid key | LLM-1 |
| 400 | `Invalid model name passed in model=<x>` | The model is not registered under that name | LLM-2 |
| 500 | starts with `Custom code guardrail execution failed: Blocked by the content-safety guardrail:` | The guardrail decided; read the reason | GRD-1 |
| 500 | anything else | A backend or model error | MOD-* |
Expand Down Expand Up @@ -50,7 +50,7 @@ Classify by the JSON body (`error.type`, `error.message`) first. Status codes fo
- **Main track:** `https://litellm-ui.<base_domain_name>/ui/`, sign in through Keycloak as a member of `platform-admins` (day-0 user `platform-admin`; first password in Secret `platform-bootstrap-admin`, key `value`, namespace `keycloak`; change it at first sign-in). The browser must also resolve and trust `keycloak.<base_domain_name>`. Password and master-key login are disabled.
- **Release track:** `https://litellm.<base_domain_name>/ui/` with user `admin` and the master key as password. The trailing slash is required; without it the browser is redirected to an `http://` URL that fails.
- **Main track, path mode:** the UI is at `https://<base_domain_name>/litellm/ui/`.
- **Check URLs:** `kubectl get cm litellm-credentials -n litellm -o jsonpath='{.data}'` names the API host (`api_url` or `hostname`) and the UI host (`ui_url`; add `/ui/`). It holds no secrets.
- **Check URLs:** `kubectl get cm litellm-credentials -n litellm -o jsonpath='{.data}'` names the API host (`api_url` or `hostname`) and the UI (`ui_url`, the full address). It holds no secrets.

### LLM-8 Traces stop appearing in Langfuse
- **Check:** `kubectl get pods -n langfuse` and look at restarts of the ClickHouse pod: `kubectl describe pod -n langfuse <clickhouse-pod> | grep -A3 'Last State'`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ The newest file in `env/<env>/logs/` is the last run: `<action>-<target>-<timest
```bash
log=$(ls -t env/<env>/logs/*.log | head -1)
sed 's/\x1b\[[0-9;]*m//g' "$log" | grep -n -A4 'PLAY RECAP' | tail -20 # which pass failed
# real errors only: fatal lines with no "...ignoring" in the next 6 lines, with the 8 lines after each
sed 's/\x1b\[[0-9;]*m//g' "$log" | awk '{l[NR]=$0} END{for(i=1;i<=NR;i++) if(l[i]~/fatal:/) {ign=0; for(k=1;k<=6;k++) if(l[i+k]~/^\.\.\.ignoring/) ign=1; if(ign) continue; for(j=i-2;j<=i+8&&j<=NR;j++) if(j>0) print j": "l[j]; print "--"}}' | tail -60
# real errors only: fatal lines with no "...ignoring" in the next 6 lines, with the 8 lines after each (EXEC lines, which hold secrets in a debug log, are left out)
sed 's/\x1b\[[0-9;]*m//g' "$log" | grep -v ' EXEC ' | awk '{l[NR]=$0} END{for(i=1;i<=NR;i++) if(l[i]~/fatal:/) {ign=0; for(k=1;k<=6;k++) if(l[i+k]~/^\.\.\.ignoring/) ign=1; if(ign) continue; for(j=i-2;j<=i+8&&j<=NR;j++) if(j>0) print j": "l[j]; print "--"}}' | tail -60
```

- A `fatal:` followed by `...ignoring` is harmless. Kubespray probes things on a fresh install (`etcd --version`, `calicoctl.sh get ...`).
Expand Down Expand Up @@ -59,7 +59,7 @@ sed 's/\x1b\[[0-9;]*m//g' "$log" | awk '{l[NR]=$0} END{for(i=1;i<=NR;i++) if(l[i
- **Fix:** `./toolkit_manager.sh teardown kubernetes --env <env>`, then `install` **(changes the cluster)**.

### INS-8 `etcd : Configure | Ensure etcd is running` fails after an earlier teardown on the same host
- **Check:** `sudo journalctl -u etcd -n 50 --no-pager; ls /var/lib/etcd`
- **Check:** `sudo journalctl -u etcd -n 50 --no-pager; sudo ls /var/lib/etcd`
- **Fix:** `teardown kubernetes` again (twice has been needed), then reinstall **(changes the cluster; rebuilds the cluster)**.

### INS-9 `kubectl missing. Run './toolkit_manager.sh configure' or install it manually.` after a teardown
Expand Down
Loading