feat: aiod up <hf-link> — one-command spin + CCR wiring#7
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 2 of 3 in the gateway stack (builds on #6).
One command replaces
estimate→spin→ccr-config→ now run ccr: paste a HuggingFace link (or a profile name) and aiod sizes it, starts the stable local gateway, points CCR at the fixed127.0.0.1URL (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) + bareorg/repo; rejects Spaces/datasets/reserved namespaces + non-HF hosts withValueErrorrather than a bad id.aiod up(foreground or--detach): reuses the exactengine.launchspin_kwargs contract;--no-ccropt-out.--detachforwards--profile(so the background box matches foreground) and--eager-spinunless--no-spin, polls/healthz, reports the pid.run_gateway(..., eager_spin=False)+ a--eager-spinflag ongateway(default off → no behavior change).aiod/__main__.py(new) sopython -m aiodworks for the detached spawn.Tests
34 new (parse_repo_id matrix +
upwiring/contract incl. spin_kwargs-keys==engine.launch introspection). 127 passing, ruff clean.Reviewer caught + fixed:
--detachwas dropping the profile's concurrency/tool_parser/extra_args (divergent box) and not eager-warming.