Skip to content

[FEATURE] Compute context: clusters, machines and GPUs outside daemon.yaml #1761

Description

@edenreich

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 pure domain/, adapters in infrastructure/ (kubernetes, runpod) and a README. internal/provisioner merges into it. It is a bounded context rather than a platform package, 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, Machine and GPUInstance, 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 is provision.
  • Boundary with the agent context: the agent context keeps placement, meaning the Workspace port, teleport, leases, Session and Endpoint. 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.50

A 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: workstation

The 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/compute exists as a bounded context with a pure domain/ and a README, internal/provisioner is merged into it, and AGENTS.md lists it among the contexts.
  • ~/.infer/compute.yaml holds clusters (name, kubeconfig, context, namespace, mode, gateway_env), machines (name, address, token, tls) and gpus (provider, max_hourly). Names are unique across clusters and machines.
  • A workspace with compute takes 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 compute keeps working with its own connection and its own Gateway. Sessions created before keep their workspace's Gateway until their Orchestrators go. provisioner in config.yaml is still read, with a warning that points at compute.yaml.
  • The RunPod API key is read from ~/.infer/auth.yaml as RUNPOD_API_KEY, falling back to the old config.yaml key, and new keys are written to auth.yaml.
  • infer compute clusters|machines|gpus work as listed above, infer gpu still works, and the operator check runs once per cluster in infer compute clusters status.
  • infer daemon workspaces shows the compute each workspace runs on.
  • Docs cover the context, compute.yaml, the compute key on a workspace and the commands, in docs/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.

Activity

  1. added
    enhancement
    on Nov 8, 2026
  2. added theissue type on Nov 8, 2026
  3. changed the title [-][FEATURE] Clusters in daemon.yaml: workspaces name a cluster and share its Gateway[/-] [+][FEATURE] Compute context: clusters, machines and GPUs outside daemon.yaml[/+] on Nov 8, 2026
  4. moved this from Todo to In progress in 2026on Nov 8, 2026
  5. moved this from In progress to QA in 2026on Nov 8, 2026
  6. inference-gateway-releaser commented on Nov 8, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.249.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  7. moved this from QA to Done in 2026on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions