Skip to content

feat: aiod up <hf-link> — one-command spin + CCR wiring#7

Merged
jhammant merged 1 commit into
mainfrom
feat/aiod-up
Jun 30, 2026
Merged

feat: aiod up <hf-link> — one-command spin + CCR wiring#7
jhammant merged 1 commit into
mainfrom
feat/aiod-up

Conversation

@jhammant

Copy link
Copy Markdown
Owner

PR 2 of 3 in the gateway stack (builds on #6).

One command replaces estimatespinccr-confignow run ccr: paste a HuggingFace link (or a profile name) and aiod sizes it, starts the stable local gateway, points CCR at the fixed 127.0.0.1 URL (so CCR stops churning on every respin), and eagerly warms the box.

  • aiod/hf.py (new) parse_repo_id() — full HF URLs (/tree, /resolve, ?query, #frag, @revision) + bare org/repo; rejects Spaces/datasets/reserved namespaces + non-HF hosts with ValueError rather than a bad id.
  • aiod up (foreground or --detach): reuses the exact engine.launch spin_kwargs contract; --no-ccr opt-out. --detach forwards --profile (so the background box matches foreground) and --eager-spin unless --no-spin, polls /healthz, reports the pid.
  • run_gateway(..., eager_spin=False) + a --eager-spin flag on gateway (default off → no behavior change).
  • aiod/__main__.py (new) so python -m aiod works for the detached spawn.

Tests

34 new (parse_repo_id matrix + up wiring/contract incl. spin_kwargs-keys==engine.launch introspection). 127 passing, ruff clean.

Reviewer caught + fixed: --detach was dropping the profile's concurrency/tool_parser/extra_args (divergent box) and not eager-warming.

Collapses estimate -> spin -> ccr-config -> "now run ccr" into a single
command: paste a HuggingFace link (or a profile name), and aiod sizes it,
starts the stable local gateway, points CCR at the fixed 127.0.0.1 URL (so
CCR stops churning on every respin), and eagerly warms the box.

- aiod/hf.py (NEW): parse_repo_id() — full HF URLs (/tree, /resolve, ?query,
  #frag, @revision), bare org/repo; rejects Spaces/datasets/reserved
  namespaces and non-HF hosts with ValueError instead of a bad id.
- aiod/cli.py: `aiod up` (foreground or --detach). Reuses the exact
  engine.launch spin_kwargs contract; --no-ccr opt-out. --detach forwards
  --profile so the background box matches the foreground one, polls /healthz,
  and (this commit) forwards --eager-spin unless --no-spin so detach warms
  the box like foreground does.
- aiod/proxy.py: run_gateway(..., eager_spin=False) — when True, kicks one
  manager.ensure() at startup. Default False preserves gateway/proxy behavior.
- aiod/cli.py gateway: add --eager-spin/--no-eager-spin (default off).
- aiod/__main__.py (NEW): enables `python -m aiod` for the detached spawn.

34 new tests (parse_repo_id matrix + up wiring/contract). 127 passing, ruff clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jhammant
jhammant merged commit 537bdcd into main Jun 30, 2026
2 checks passed
@jhammant
jhammant deleted the feat/aiod-up branch June 30, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant