Repository navigation
Description
Summary
A cluster exists whether or not a daemon uses it, but today it can only be written down inside a daemon's workspace. Each Kubernetes workspace in daemon.yaml repeats its cluster connection (kubeconfig, context, namespace) and its gateway (mode, gateway_env) next to what describes the computer itself (image, storage, idle_ttl, retention, env, forward_env, secrets). A daemon workspace does the same with its machine (address, token, tls). Twelve agents on one cluster means twelve copies of the same cluster settings, and twelve Gateways, because a standard-mode workspace deploys its own Gateway named from a hash of the workspace name (gatewayName in internal/agent/infrastructure/kubernetes/gateway.go).
Rented GPUs are capacity too, but they live elsewhere. internal/provisioner rents RunPod pods running llama.cpp for infer gpu, with its settings, the RunPod API key included, in config.yaml under provisioner.
This gives compute its own bounded context. Clusters, standalone machines and rented GPUs are what you run on, and the daemon is only one of their users.
The compute context
- Where:
internal/compute, with a puredomain/, adapters ininfrastructure/(kubernetes,runpod) and a README.internal/provisionermerges into it. It is a bounded context rather than aplatformpackage, because it carries rules of its own: a cluster's namespace is shared by its workspaces, one Gateway runs per cluster, and GPU spend has a cap. - Aggregates:
Cluster,MachineandGPUInstance, separate inside one context. They share the lifecycle language, credentials and cost, but little behaviour. One of them splits into its own context when it grows its own language, such as billing and quotas for GPUs. - Language: registering capacity you already have is
add. Creating capacity you pay for isprovision. - Boundary with the agent context: the agent context keeps placement, meaning the
Workspaceport, teleport, leases,SessionandEndpoint. The Kubernetes workspace adapter keeps the per-session work (one Orchestrator per session, its TLS Secret, the port-forward) and takes its cluster from compute. Compute owns the cluster connection, the operator check and the cluster's shared Gateway with its credentials Secret. Dependencies point from agent infrastructure to compute's domain, never back.
Configuration
Compute has its own userspace file, like mcp.yaml. A project-level compute.yaml is not read, because capacity belongs to the user, not to a project.
# ~/.infer/compute.yaml
clusters:
- name: k3d-agents
context: k3d-agents
namespace: agents
mode: standard
gateway_env:
- ANTHROPIC_API_KEY
machines:
- name: workstation
address: workstation.lan:52789
token: ${WORKSTATION_TOKEN}
tls:
ca_file: ~/.infer/daemon/workstation-ca.crt
gpus:
provider: runpod
max_hourly: 1.50A workspace names the compute it runs on, and its kind follows from what it names:
# ~/.infer/daemon.yaml
workspaces:
- name: code-reviewer
compute: k3d-agents
image: ghcr.io/inference-gateway/cli:latest
secrets:
- code-reviewer-credentials
- name: build-box
compute: workstationThe namespace belongs to the cluster, because an Orchestrator's spec.gateway.ref only names a Gateway in its own namespace. One Gateway per cluster needs every workspace on it in the same namespace.
Commands
infer compute clusters add | list | status | remove
infer compute machines add | list | status | remove
infer compute gpus provision | list | status | destroy
infer gpu stays as a hidden alias of infer compute gpus. infer daemon workspaces stays where it is, because it reports where the daemon can place sessions. infer --help lists compute under a Platform group. Nesting the commands under infer platform waits until that group has a second member.
Acceptance Criteria
-
internal/computeexists as a bounded context with a puredomain/and a README,internal/provisioneris merged into it, and AGENTS.md lists it among the contexts. -
~/.infer/compute.yamlholdsclusters(name,kubeconfig,context,namespace,mode,gateway_env),machines(name,address,token,tls) andgpus(provider,max_hourly). Names are unique across clusters and machines. - A workspace with
computetakes its connection, namespace, gateway and kind from the compute it names. Setting any of those on such a workspace, or naming compute that does not exist, fails validation. - A standard-mode cluster deploys one Gateway and one credentials Secret, named after the cluster, and every Orchestrator of its workspaces references it. The Gateway goes with the last Orchestrator that owns it.
- Nothing breaks on upgrade. A workspace without
computekeeps working with its own connection and its own Gateway. Sessions created before keep their workspace's Gateway until their Orchestrators go.provisionerinconfig.yamlis still read, with a warning that points atcompute.yaml. - The RunPod API key is read from
~/.infer/auth.yamlasRUNPOD_API_KEY, falling back to the oldconfig.yamlkey, and new keys are written toauth.yaml. -
infer compute clusters|machines|gpuswork as listed above,infer gpustill works, and the operator check runs once per cluster ininfer compute clusters status. -
infer daemon workspacesshows the compute each workspace runs on. - Docs cover the context,
compute.yaml, thecomputekey on a workspace and the commands, indocs/daemon.md, the configuration reference and a compute page.
Related: inference-gateway/desktop#474, whose Compute tab writes compute.yaml. #1760 adds mcp_servers to a workspace, which stays a workspace key.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][FEATURE] Clusters in daemon.yaml: workspaces name a cluster and share its Gateway[/-][+][FEATURE] Compute context: clusters, machines and GPUs outside daemon.yaml[/+]feat(compute): write clusters and machines down once in compute.yaml (#…
feat(compute): rent GPUs from the compute context as infer compute gpus
feat(compute): manage clusters and machines with infer compute
inference-gateway-releaser commentedon Nov 8, 2026
🎉 This issue has been resolved in version 0.249.0 🎉
The release is available on:
Your semantic-release bot 📦🚀