Configure Goose Custom Provider for Headroom
Create and configure a Goose custom provider that points to the local
Headroom context-optimization proxy. This skill covers only the Goose
provider configuration — for Headroom installation and systemd setup, see
the headroom-litellm-proxy skill.
Rules
Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution. If a command fails, report the actual error — do not guess.
Do NOT skip steps or combine multiple operations into one step. Execute each step in order and verify before proceeding.
Traffic Chain
Goose (custom_headroom) → Headroom Proxy (:8787) → LiteLLM (:4000) → Vertex AI (Claude)
↑ context compression ↑ model routing
Prerequisites
- Goose installed (
gooseCLI or Goose Desktop) - Headroom proxy running on port 8787 (use
headroom-litellm-proxyskill to set up; verify withheadroom-proxy-statusskill) - LiteLLM proxy running on port 4000 (upstream of Headroom)
Reference Configuration
Custom Provider JSON
File: ~/.config/goose/custom_providers/custom_headroom.json
{
"name": "custom_headroom",
"engine": "openai",
"display_name": "Headroom",
"description": "Headroom context-optimization proxy → LiteLLM (Vertex AI Claude models)",
"api_key_env": "",
"base_url": "http://host.containers.internal:8787",
"models": [
{
"name": "claude-opus-5",
"context_limit": 1000000,
"input_token_cost": null,
"output_token_cost": null,
"currency": null,
"supports_cache_control": null,
"reasoning": false
}
],
"headers": null,
"timeout_seconds": 600,
"supports_streaming": true,
"requires_auth": false,
"catalog_provider_id": null,
"base_path": null,
"env_vars": null,
"dynamic_models": null,
"skip_canonical_filtering": false,
"model_doc_link": null,
"setup_steps": [],
"fast_model": null,
"preserves_thinking": true
}
modelsis generated, not hand-written.setup.shbuilds it from LiteLLM/model/info(Headroom’s upstream): one entry per served model,context_limit=max_input_tokens. The block above shows one entry. Current list:hey litellm model list.
config.yaml Provider Entry
providers:
custom_headroom:
enabled: true
model: claude-opus-5
configured: true
.env Entry
File: ~/.config/goose/.env
CUSTOM_HEADROOM_API_KEY=sk-EXAMPLE-not-real
The API key value is a placeholder — Headroom does not require
authentication by default. However, Goose custom providers expect an
entry in .env for the <NAME>_API_KEY pattern.
Key Fields Explained
| Field | Value | Why |
|---|---|---|
name |
custom_headroom |
Internal identifier; must match config.yaml |
engine |
openai |
Headroom exposes OpenAI-compatible /v1/chat/completions |
display_name |
Headroom |
Friendly name shown in provider picker |
base_url |
http://host.containers.internal:8787 |
Local Headroom proxy address |
requires_auth |
false |
Headroom proxy does not require authentication |
api_key_env |
"" |
No API key environment variable needed |
timeout_seconds |
600 |
10-minute timeout for long-running requests |
supports_streaming |
true |
Headroom supports streaming responses |
preserves_thinking |
true |
Pass through Claude thinking blocks |
models |
(see JSON) | Must match models available in upstream LiteLLM |
Workflow
Step 1 — Run the setup script
The agent MUST run:
bash ~/.agents/skills/goose-headroom-provider/scripts/setup.sh
The script checks the Headroom proxy health, creates the custom provider
JSON, adds the .env API key entry, and verifies config.yaml. Use --check
to verify without making changes.
Step 2 — Register in config.yaml
If the setup script reports that custom_headroom is not in config.yaml,
the agent MUST add the provider entry. Use goose configure or manually
edit ~/.config/goose/config.yaml.
Step 3 — Add to Goose config.yaml
Add the provider entry under providers: in ~/.config/goose/config.yaml:
custom_headroom:
enabled: true
model: claude-opus-5
configured: true
Add to ~/.config/goose/.env:
CUSTOM_HEADROOM_API_KEY=sk-EXAMPLE-not-real
Step 4 — Configure via goose configure CLI (Alternative)
Alternatively, use the interactive wizard:
goose configure
- Select Custom Providers
- Select Add A Custom Provider
- API Type → OpenAI Compatible
- Name →
Headroom - API URL →
http://host.containers.internal:8787 - Authentication Required → No
- Available Models → output of
hey litellm model list(comma-separated) - Streaming Support → Yes
Step 5 — Switch to the Headroom Provider
Set as active provider in ~/.config/goose/config.yaml:
active_provider: custom_headroom
Or use the interactive wizard:
goose configure
- Select Configure Providers
- Select Headroom from the list
- Choose your preferred model
Step 6 — Verify config.yaml
grep -A3 'custom_headroom' ~/.config/goose/config.yaml
grep 'active_provider' ~/.config/goose/config.yaml
Expected output:
custom_headroom:
enabled: true
model: claude-opus-5
configured: true
active_provider: custom_headroom
Step 7 — Test from CLI
goose run -t "Say hello in one sentence"
Verify the response comes through the Headroom → LiteLLM chain.
Comparing Providers: Headroom vs Direct LiteLLM
You can A/B compare by switching active_provider in config.yaml:
| Provider | Path | Context optimization |
|---|---|---|
custom_redhat |
Goose → LiteLLM (:4000) → Vertex AI | None |
custom_headroom |
Goose → Headroom (:8787) → LiteLLM (:4000) → Vertex AI | ✅ Automatic compression |
Both use the same upstream models. The Headroom provider adds a compression layer that reduces token usage on long conversations.
Check compression savings anytime:
curl -s http://127.0.0.1:8787/stats | python3 -m json.tool
Recovery Procedure
If the Headroom custom provider is lost (e.g., after a config reset):
- Ensure Headroom proxy is running (use
headroom-proxy-statusskill) - Copy the JSON file from this skill’s reference into
~/.config/goose/custom_providers/custom_headroom.json - Add the provider entry to
~/.config/goose/config.yamlunderproviders: - Add API key to
~/.config/goose/.env:CUSTOM_HEADROOM_API_KEY=sk-EXAMPLE-not-real - Set
active_provider: custom_headroomin config.yaml - Restart Goose — the Headroom provider will be available
Quick Recovery
bash ~/.agents/skills/goose-headroom-provider/scripts/setup.sh --dry-run
bash ~/.agents/skills/goose-headroom-provider/scripts/setup.sh
setup.sh recreates custom_headroom.json with the model list from
LiteLLM and adds the .env key. It does not rewrite an existing JSON;
when its model list drifts from LiteLLM it prints the regenerate command
(mv … .bak && bash setup.sh).
Verification Checklist
- Headroom proxy running and healthy (prerequisite)
custom_headroom.jsonexists in~/.config/goose/custom_providers/config.yamlhascustom_headroominproviders:withenabled: trueCUSTOM_HEADROOM_API_KEY=sk-EXAMPLE-not-realis in~/.config/goose/.envgoose configureshows Headroom in the provider list- A test chat via Goose returns a valid LLM response
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Headroom not in provider list | Missing JSON file | Copy custom_headroom.json to ~/.config/goose/custom_providers/ |
| “Connection refused” on :8787 | Headroom proxy not running | systemctl --user start headroom-proxy (see headroom-litellm-proxy skill) |
ℹ️ Model list differs from LiteLLM |
Proxy model list refreshed (refresh litellm models) after the JSON was created |
Run the printed mv … .bak && bash setup.sh command |
| Provider shows but won’t connect | base_url wrong in JSON |
Verify http://host.containers.internal:8787 |
| Only 1 model available | Models not listed in JSON | Update the models array to match LiteLLM models |
| Config lost after update | Goose config reset | Re-run the recovery procedure above |
| Timeout on long requests | timeout_seconds too low |
Increase from 600 to a higher value |
No compression visible in /stats |
Short messages don’t compress | Use longer conversations; check curl http://host.containers.internal:8787/stats |
Changelog
See CHANGELOG.md for version history.