Core

Architecture

Glider operates with your AI coding CLI. It works with Claude Code, with Cursor Agent and with Antigravity (agy). Glider is one Go program (cmd/glider). It has three network interfaces and one shared completion pipeline. No code in that pipeline makes a decision from the name of the CLI.

The network interfaces

InterfacePortConfigFunction
Gateway:8080server.proxy_portGives the OpenAI /v1/* endpoints, and the Anthropic /v1/messages. Set Override Base URL in the CLI to this address.
MITM proxy:8082 (and :8083 for transparent mode)mitm.portDecrypts CONNECT traffic and transparent traffic. Does the delegation and the origin passthrough. Refer to MITM.
Dashboard:8081server.dashboard_portGives the operator interface, the REST /api/* endpoints and the /ws WebSocket. It also serves this documentation.
┌────────────────────────────────── glider.exe (one process) ──────────────────────────────────┐
│                                                                                              │
│  ┌─────────────────┐   Complete()    ┌────────────────────────────┐                          │
│  │ Gateway :8080   │────────────────▶│   Shared harness           │──▶ Ollama / vLLM / BYOK  │
│  │ internal/api    │                 │   PipelineCompleter        │                          │
│  └─────────────────┘                 │   router · transform ·     │                          │
│                                      │   executor · metrics ·     │                          │
│  ┌─────────────────┐ DecideLocal /   │   contextgraph             │                          │
│  │ MITM :8082      │ CompleteLocal ▶│                            │──▶ CLI's own origin       │
│  │ internal/mitm   │                 └─────────────▲──────────────┘   (passthrough)          │
│  └─────────────────┘                               │                                         │
│                                                    │ REST / WS                               │
│  ┌─────────────────┐                               │                                         │
│  │ Dashboard :8081 │───────────────────────────────┘                                         │
│  └─────────────────┘                                                                         │
│  Disk: ~/.glider/{mitm,history,context} · configs/*.yaml (watched)                           │
└──────────────────────────────────────────────────────────────────────────────────────────────┘

The shared pipeline

Each completion goes through one orchestrator.PipelineCompleter. This is true for the gateway and for MITM. Only CompleteOptions.OriginPassthrough is different. For a request that is not local, the gateway uses your own cloud key. But MITM sends the request to the origin of the CLI.

CompletionRequest
  → ApplyModelAlias           (model_aliases: for example, gpt-4o → qwen2.5-coder:14b)
  → Tokenizer.EstimateRequestTokens
  → router.Engine.Route       (refer to routing.html for the full priority sequence)
  → [origin gate — MITM only. A request that is not local → ErrOriginPassthrough]
  → episodes + BoundLocalContext   (local only. Never the full history.)
  → Transformer.Apply         (you must turn this on. It is off when you start.)
  → Executor.Execute          (Ollama | vLLM | OpenAI | Anthropic. Backup sequence, circuit breaker.)
  → metrics + contextgraph events

A message with a /vendor flag (/claude, /cursor-agent or /agy) does not go into this pipeline. DelegateHandler takes the message first. On the gateway, the /v1/messages route takes it. Refer to Delegation.

The packages

PackageFunction
apiGives the gateway HTTP endpoints /v1/chat/completions, /v1/responses and /v1/models
orchestratorHolds PipelineCompleter, the backup sequence, the circuit breaker, the VRAM control and the fan-out
routerApplies the rules in priority sequence: explicit, sticky, classifier, Starlark, then the token limit
mitmDecrypts CONNECT traffic and transparent traffic. Holds the Cursor Agent RPC hub and the delegate handler.
vendorsDoes the delegation to another CLI: it finds the CLIs, runs them, relays the permissions and continues a run
nglNative Glider Language. It gives one message format for all vendors (Turn, Part and EditViews).
cursorrpcCursor only. Reads the Connect protobuf data and encodes and decodes RunSSE.
contextgraphKeeps the event log that Glider only adds to, and the graph of entities. Refer to Context.
backendGives the completion clients ollama, vllm and cloud (OpenAI and Anthropic)
transformCounts the tokens, applies BoundLocalContext and can change a prompt
vramMonitors nvidia-smi, applies the allocation strategy, reserves and releases memory, and makes the eviction plan
metricsSends data from the collector to the bus (the dashboard WebSocket) and to the history file
dashboardGives the operator interface and the REST and WebSocket API. It also serves this documentation.
configReads the YAML, checks it, and monitors the file for changes
hotswapHolds the registry of the modules that can accept a new config (fan_out, backends and classifier)
procinfoFinds the PID and the process name from a TCP connection
trayGives the system tray icon and the Exit command. This applies to Windows only.
toolsHolds the internal tools, the MCP servers and the sandbox of the workspace. Refer to Tools & MCP.
mcpSpeaks the MCP protocol: the transport with stdio, the Streamable HTTP client, and the authorization for GitHub.
summarizerAdapts a backend for inference to the shape that the compaction of the continuity record needs. Refer to Context.
contextkitKeeps the state of a session, an episode and a turn budget for the swarm and the loop.
pluginGives the life cycle and the capabilities of a plugin of Glider.
runstateSays if the previous run of Glider stopped correctly. A stop that is not clean can leave the rules of the redirector on the machine.
atomicfileWrites a file completely, or not at all. A file with a part of its content is worse than no new file.
fileaclLimits who can read a file with sensitive content, such as a token.
safegoStarts a goroutine with a long life, and it does not let a panic stop the program.
procutilSmall helpers for one OS, to start a process.
webviewshellPuts the dashboard in a window of the operating system, in place of a browser tab.

When you must restart Glider

Glider accepts these changes while it runs (config.Provider.Watch): the routing rules, the model aliases, the transform config, the log level, the backend and model clients, and the hot-swap modules. You must restart Glider after you change these: the ports, the MITM CA, the MITM host list, and the transparent interception settings.

What Glider does after a failure

ConditionResult
Circuit breakerGlider counts the failures of each backend. After 5 failures it stops that backend for 30 seconds. Then it sends one test request.
Backup sequenceGlider examines the health, the circuit breaker and the warm condition. If the local model fails, Glider uses your cloud key. You can turn this off. If all backends fail, Glider gives error 502.
ErrOriginPassthroughMITM only. For a request that is not local, Glider sends the request to the origin of the CLI. The credentials do not change.
A local failure in hybrid modeGlider sends the request to the origin. The setting is mitm.origin_on_local_error.
Pure local modeSet origin_on_local_error: false. Glider then shows the error and does not use the origin.

Notes on concurrency

The config profiles