Repository navigation
Description
Update 2026-11-26 (infra move): the Portkey manifests go to dan-petty/homelab.
This issue keeps the removal of the provider and of ai.portkey_url from src/ with its tests, documents and specs, and of the three llm/portkey/ lines of MANIFESTS_BY_STACK. k8s/llm/portkey/ and its kustomization and NetworkPolicy lines are deleted in homelab. Merge the two changes together, else deploy-stack can name a missing file.
Follow-up: dan-petty/homelab#288.
Problem or Motivation
Portkey has no client: 0 log lines in 7 d, no route, egress only to Ollama, and the live config uses provider gateway. It holds 200m CPU and 256Mi of requests for 1m and 81Mi of use. It is one more gateway to patch and document, and no ADR keeps it. This item is rank 17 of the cluster integration plan #4989.
Proposed Solution & Architectural Design
- Delete the
llm/portkey/lines ofMANIFESTS_BY_STACK. The manifests are deleted in dan-petty/homelab. - Remove the portkey provider from
src/devops_cli(9 files). - Add
ai.portkey_urltoCONST_REMOVED_CONFIG_KEYS, so that the load error namesdevops config unset ai.portkey_url.
Owner decision
After the merge, run devops config unset ai.portkey_url on each workstation config. The ai section refuses unknown keys, and agents never change config.yaml. The recommended answer on #4989 is yes.
Target Subsystem
AI & Agentic Review Pipeline (src/devops_cli, k8s/llm/).
Existing Tool Considered
The LiteLLM gateway already serves every route. Removal builds nothing.
Acceptance Criteria
git grep -i portkeyfinds only the removed-key entry, its test and the changelog.- A config with
ai.portkey_urlfails to load, and the error namesdevops config unset ai.portkey_url. - Argo CD prunes the Portkey objects.
Dependencies
None. Owner decision 4 on #4989 comes after the merge.
Source: #4989
Alternatives check of 2026-11-26: not-applicable.
Class: chore, no model call.
Tool: none found.
Proposed design
Problem statement
Portkey runs in the cluster with no client: no route names it, it served no request in 7 days, and its traffic went only to Ollama. It holds 200m CPU and 256Mi of requests while it uses 1m and 81Mi, it is one more gateway to patch and document, and no ADR keeps it. The change deletes k8s/llm/portkey/ and the Portkey provider in src/devops_cli, and it updates the tests, the documents, the example config, the research watch note and the two live specs that name it. LiteLLM and Ollama stay, and a person unsets ai.portkey_url on each workstation config after the merge.
Acceptance criteria
Requirement: Cascade provider list
The cascade model MUST build with no Portkey provider and no ai.portkey_url.
Scenario: Cascade with no Portkey URL
- WHEN A test builds the
cascademodel from settings withai.portkey_urlunset. - THEN The build raises no
ConfigurationError, andCONST_AI_CASCADE_PROVIDERSholds noportkeyentry.
Requirement: Gateway provider value
The ai settings MUST refuse an ai.gateway_provider that names no gateway the project serves.
Scenario: A leftover Portkey gateway provider
- WHEN A test loads a settings dict that holds
ai.gateway_provider: portkey. - THEN The load fails, and the error names
litellmas the gateway provider to set.
Requirement: AI settings fields
The ai settings section MUST declare no portkey_url field.
Scenario: Fields of the ai section
- WHEN A test reads the fields of the
AIConfigsettings model. - THEN The field names hold no
portkey_url.
Requirement: Refused config key
A config that holds ai.portkey_url MUST fail to load and MUST name devops config unset ai.portkey_url.
Scenario: Loader refuses the removed key
- WHEN A test passes a settings dict that holds
ai.portkey_urlto the config loader. - THEN The load fails, and the error text names
devops config unset ai.portkey_url.
Requirement: Gateway provider constants
The gateway provider constants MUST hold no Portkey provider or Portkey URL setting.
Scenario: Gateway provider constants
- WHEN A test reads
CONST_AI_GATEWAY_PROVIDERS,CONST_AI_GATEWAY_PROVIDER_PORTKEYandCONST_AI_GATEWAY_URL_SETTINGS. - THEN The provider tuple holds no
portkey, the Portkey provider constant is absent, and the URL settings map has noportkeykey.
Requirement: No Portkey reference
The live source, the documents, the research watch list and the live specs MUST hold no portkey reference.
Scenario: Search the live files at the branch head
- WHEN A test runs
! git grep -n -i -F portkey src/ docs/CONFIGURATION.md docs/MCP_TOOLS.md docs/commands/ai.md docs/SERVICE_PATTERNS.md k8s/README.md .devops/research-watch.toml openspec/specs/at the branch head. - THEN The test passes and the command prints no line.
Requirement: Portkey manifests
The change MUST delete k8s/llm/portkey/ and each kustomization, policy and gate entry that names it.
Scenario: The k8s check
- WHEN
uv run devops ci --check --only k8sruns on the branch. - THEN The check reports success.
Requirement: Generated documents
The generated settings and command documents MUST hold no Portkey row.
Scenario: The docs check
- WHEN
uv run devops ci --check --only docsruns on the branch afteruv run devops docs generate. - THEN The docs row reports success.
Requirement: Argo CD prunes Portkey
After the merge, Argo CD MUST prune each Portkey object of the cluster.
Scenario: Live check after the merge
- WHEN After the merge,
kubectl get deployment,service,configmap -A -o name | grep -i portkeyruns on the cluster. - THEN The command returns no line.
Existing Tool Considered
The alternatives check of 2026-11-15 gives verdict not-applicable (class chore, no search), so it names no tool. The open, maintained gateway that covers the remaining need is LiteLLM (ghcr.io/berriai/litellm, .devops/research-watch.toml). It already serves every route that remains. The change adds no code that the project builds or keeps, so the build cost is 0 tokens and 0 elapsed time.
Key questions
- Which live files hold the Portkey provider and manifests that the change removes?: The code holds the Portkey constants in
src/devops_cli/config/constants.pyand theportkey_urlfield insrc/devops_cli/config/settings.py. The router holds the Portkey URL and provider branches insrc/devops_cli/ai/gateway.py, and the spend report reads the URL insrc/devops_cli/ai/spend/pricing.py. The bridge and the--providerhelp also name it. The manifests arek8s/llm/portkey/,k8s/llm/kustomization.yaml,k8s/llm/networkpolicy.yamland the gate exemption intests/gate/k8s_checks/monitoring.py. The documents and live specs areconfig.example.yaml,docs/CONFIGURATION.md,docs/MCP_TOOLS.md,docs/commands/ai.md,docs/SERVICE_PATTERNS.md,k8s/README.md,.devops/research-watch.toml,openspec/specs/ai-gateway-routing/spec.mdandopenspec/specs/k8s-network-policies/spec.md. [sources: src/devops_cli/config/constants.py, src/devops_cli/config/settings.py, src/devops_cli/ai/gateway.py, src/devops_cli/ai/spend/pricing.py, src/devops_cli/ai/pydantic_ai_bridge.py, src/devops_cli/commands/ai_gateway.py, k8s/llm/kustomization.yaml, k8s/llm/networkpolicy.yaml, tests/gate/k8s_checks/monitoring.py, config.example.yaml, docs/CONFIGURATION.md, docs/MCP_TOOLS.md, docs/commands/ai.md, docs/SERVICE_PATTERNS.md, k8s/README.md, .devops/research-watch.toml, openspec/specs/ai-gateway-routing/spec.md, openspec/specs/k8s-network-policies/spec.md] - Does the load error name
devops config unset ai.portkey_urlwithout an entry inCONST_REMOVED_CONFIG_KEYS?: Yes._describeinsrc/devops_cli/config/unknown_keys.pybuildsdevops config unset <dotted key>for each key that a section refuses._reasonadds a release only when the removed-key map holds the key. A config withai.portkey_urltherefore fails to load and names the command before the map entry exists. [sources: src/devops_cli/config/unknown_keys.py, src/devops_cli/config/constants.py, docs/CONFIGURATION.md] - Must the change remove
portkeyfromCONST_AI_CASCADE_PROVIDERSin the same pull request?: Yes. The tuple holds(litellm, portkey, ollama)today. The bridge readsai.portkey_urlfor the Portkey member. A cascade member with an unset URL raises aConfigurationError. The same pull request removes the member. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/ai/pydantic_ai_bridge.py]- Chosen: Remove the member in this change. The
cascademodel fails as soon as a person unsetsai.portkey_url, which is the owner's step after the merge. - Rejected: File a separate item for the tuple. It leaves the
cascademodel broken between two merges.
- Chosen: Remove the member in this change. The
- What does a config that still holds
ai.gateway_provider: portkeydo?: A config withai.gateway_provider: portkeymust fail at load. The field is a plain string today. After the removal, the value would fall through the router toai.gateway_urland build a model with an unknownportkey:prefix. The change adds a field validator that admits onlyCONST_AI_GATEWAY_PROVIDERS. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/config/constants.py, src/devops_cli/ai/gateway.py]- Chosen: Refuse the value at load and name the remaining gateway. A leftover value fails closed with a fix, as an unknown settings key does.
- Rejected: Accept the value and fall back to LiteLLM. It sends the models to a gateway URL that the value does not name and reports an unrelated model error later.
- Rejected: Leave the field with no validator. The router would build a model with an unknown
portkey:prefix.
- Does the change update the live specs that name Portkey?: Yes.
openspec/specs/ai-gateway-routing/spec.mdsays a configured gateway has the origin ofai.gateway_urlorai.portkey_url.openspec/specs/k8s-network-policies/spec.mdrequires the Portkey perimeter NetworkPolicy. The change edits both with the removal, so no live requirement names a setting or a policy that no longer exists. (best practice) [sources: openspec/specs/ai-gateway-routing/spec.md, openspec/specs/k8s-network-policies/spec.md]- Chosen: Edit both live specs in this change. Both requirements name a setting and a manifest that the change deletes.
- Rejected: Leave the specs for a later item. The live spec then requires a setting that no config can hold and a policy that no manifest declares.
- Must the change remove the note about the
portkeyai/gatewayimage from.devops/research-watch.toml?: Yes. The file holds no watch entry for the image. Line 30 is the last item of theNot mappedcomment at lines 28-30. The change removes that item because the image leaves the repository. (best practice) [sources: .devops/research-watch.toml]- Chosen: Remove the
Not mappeditem. The note names an image that no manifest pins after the change. - Rejected: Keep the note. It documents an image that the project no longer deploys.
- Chosen: Remove the
- Which Portkey references stay in the tree?: Keep
CHANGELOG.md,docs/SELF_IMPROVEMENT.mdand the archived OpenSpec changes underopenspec/changes/archive/. They record a past release or a past scan. The change removes live references only. (best practice) [sources: CHANGELOG.md, docs/SELF_IMPROVEMENT.md, openspec/changes/archive/2026-10-27-2046-portkey-unused-config/proposal.md]- Chosen: Keep the release and scan records. A changelog entry and a remediated finding record a past release, not a live reference.
- Rejected: Rewrite the records. It edits the history that release-please writes and the record of a past finding.
- What does a person do with
ai.portkey_urlon each workstation config after the merge?: Rundevops config unset ai.portkey_urlon each workstation config after the merge. Theaisection refuses the unknown key. Agents never changeconfig.yaml, so a person runs the command. (a person decides) [sources: src/devops_cli/config/unknown_keys.py, docs/CONFIGURATION.md]
Open questions
- What does a person do with
ai.portkey_urlon each workstation config after the merge? (a person decides)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
This is a cleanup of unused resources with no user-facing change and no urgency.Both remove leftover code from a removed gateway, but #820 targets vLLM while the candidate targets Portkey.dan-petty commentedon Nov 13, 2026
New evidence (2026-11-13, read-only investigation of the LiteLLM gateway):
ai.portkey_urlholds the same URL asai.gateway_url. Thusdevops ai gateway statusanddevops ai gateway routes --provider portkeyprobe LiteLLM, not Portkey.k8s/llm/portkey/networkpolicy.yamlallows egress only to Ollama port 11434 and DNS. Loki over 7 days: 16 Portkey lines, all from the 2026-11-12T14:29Z rollout, and no request. Nox-portkey-*header is insrc.CONST_AI_CASCADE_PROVIDERS = (litellm, portkey, ollama)(src/devops_cli/config/constants.py:2951) usesai.portkey_urlfor its second step, so the cascade calls LiteLLM a second time.portkeyfromCONST_AI_CASCADE_PROVIDERS. If not, the modelcascadefails with aConfigurationErrorwhen the URL is unset (src/devops_cli/ai/pydantic_ai_bridge.py:84-90,302-307).devops-cli-service commentedon Nov 15, 2026
Alternatives check: not-applicable
Class: chore. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 19, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 20, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence