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 has 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 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. The change removes the Portkey provider and ai.portkey_url from src/, updates tests, documents and specs, and removes the three llm/portkey/ lines of MANIFESTS_BY_STACK. dan-petty/homelab#288 deletes the manifests in homelab, and both changes merge together.
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: 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: Removed key record
CONST_REMOVED_CONFIG_KEYS MUST hold ai.portkey_url.
Scenario: Removed key map
- WHEN A test reads
CONST_REMOVED_CONFIG_KEYS. - THEN The map holds the key
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: Manifest stack entries
MANIFESTS_BY_STACK MUST hold no llm/portkey/ entry.
Scenario: Manifest stack list
- WHEN A test reads
MANIFESTS_BY_STACK. - THEN No value holds the text
llm/portkey/.
Requirement: No Portkey reference
The live source, the documents, the research watch list and the live specs MUST hold no portkey reference, except the removed-key entry in src/devops_cli/config/constants.py.
Scenario: Search the live files at the branch head
- WHEN A test runs
! git grep -n -i -F portkey src/ ':!src/devops_cli/config/constants.py' docs/CONFIGURATION.md docs/MCP_TOOLS.md docs/commands/ai.md docs/SERVICE_PATTERNS.md config.example.yaml k8s/README.md .devops/research-watch.toml openspec/specs/at the branch head. - THEN The test passes and the command prints no line.
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: Pending a person after the merge
Each workstation config MUST no longer hold ai.portkey_url after the merge.
Scenario: Workstation config cleanup
- WHEN After the merge, a person runs
devops config unset ai.portkey_urlon each workstation config. - THEN The command succeeds, and the next settings load reports no error.
Requirement: Pending a person after the merge
The change MUST merge together with dan-petty/homelab#288, which deletes the Portkey manifests.
Scenario: Coordinated merge and cluster prune
- WHEN A person merges this change and
dan-petty/homelab#288together. - THEN Argo CD prunes the Portkey objects, and
kubectl get deployment,service,configmap -A -o name | grep -i portkeyreturns no line.
Existing Tool Considered
The alternatives check of 2026-11-26 in the issue body gives verdict not-applicable and names no tool. The change removes code and adds one removed-key entry, so it builds no tool or library: the cost is 0 tokens and 0 elapsed time. The LiteLLM gateway already serves every remaining route.
Key questions
- Which live files hold the Portkey provider and the
ai.portkey_urlsetting that the change removes?: The code holds the Portkey constants insrc/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 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, 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. The change adds the map entry to record the release. [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
- 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.
- How does the change handle
ai.portkey_urlon workstation configs after the merge?: The change addsai.portkey_urltoCONST_REMOVED_CONFIG_KEYS, so the load error namesdevops config unset ai.portkey_url. After the merge, a person runs that command on each workstation config. Agents never changeconfig.yaml. (best practice) [sources: src/devops_cli/config/unknown_keys.py, src/devops_cli/config/constants.py, docs/CONFIGURATION.md]- Chosen: Add the key to the removed-key map and let a person unset it after the merge. The
aisection refuses unknown keys, and an agent must not changeconfig.yaml. - Rejected: Change
config.yamlin this pull request. The repository rules forbid an agent from changingconfig.yaml.
- Chosen: Add the key to the removed-key map and let a person unset it after the merge. The
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
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
chore(k8s): remove unused Portkey gateway and provider (#5007)
chore(main): release 0.248.0 (#7763)
devops-cli-service commentedon Nov 29, 2026
Released in v0.248.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.248.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:50 UTC