You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automations: per-run LiteLLM tags on community (filter caller tags in usage hook + allow_client_tags on workspace keys only) #165
Part of #160 / follow-up of #162 (T0 spike, 2026-10-10).
LiteLLM 1.83.14 drops the x-litellm-tags header unless the key/team has metadata.allow_client_tags: true (litellm_pre_call_utils.py L1151-1191, L1385). Community has the flag on 0/998 keys and 0/7 teams, so per-run tags (nan-run:<uuid>) never reach SpendLogs; Phase 1 settles usage from agent-reported usage instead.
Security constraint: enabling allow_client_tags as-is would let a member spoof client_ip: / country: tags, because the API-key-sharing ETL (docker/abuse-detection-etl/etl.py:79-91) takes the FIRST such tag and caller tags come first.
Tasks:
Community usage hook: drop every caller-supplied tag except ^nan-run:[0-9a-f-]{36}$ (with tests, including known-bad spoof attempts), before the hook appends its own tags
Set metadata.allow_client_tags: true ONLY on workspace keys (those with metadata.workspace_uuid), never on the team or member main keys; include it in EnsureWorkspaceKeys
Hermes: add model.extra_headers: {x-litellm-tags: '${NAN_RUN_TAGS}'} in render_hermes_config (cloud-api) and buildHermesConfigYAML (nan-vmd)
Verify end to end on community with >= 30 requests per route that every row is tagged and that spoofed client_ip/country tags are dropped
Done and verified in prod on 2026-10-11: usage hook caller-tag filter (nan-devops #806) deployed to every litellm-community/litellm-test pod (0 spoofed client_ip/country tags in SpendLogs over 60 spoof requests); allow_client_tags on workspace keys only (cloud-api #327, 0.8.241; backfill dry-run → 1 key → all 19, no field lost, no member key or team flagged); a real Pi run's SpendLogs rows carry nan-run: exactly once and the runs settler reports tokens_source=litellm (3230 in / 224 out).
Activity
sre-helmcode commentedon Oct 11, 2026
Done and verified in prod on 2026-10-11: usage hook caller-tag filter (nan-devops #806) deployed to every litellm-community/litellm-test pod (0 spoofed client_ip/country tags in SpendLogs over 60 spoof requests); allow_client_tags on workspace keys only (cloud-api #327, 0.8.241; backfill dry-run → 1 key → all 19, no field lost, no member key or team flagged); a real Pi run's SpendLogs rows carry nan-run: exactly once and the runs settler reports tokens_source=litellm (3230 in / 224 out).