Draft
Teams(jobs): mock drop-in stub for the full HF Jobs API#69
Conversation
Agent-Logs-Url: https://github.com/Atena-IT/open-hub/sessions/f7ba62e4-61e5-40c7-9f70-c473f5f6c797 Co-authored-by: DiTo97 <40361744+DiTo97@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add mocked support for HF's Jobs API
thread(jobs): mocked drop-in stub for the full HF Jobs API
Mar 31, 2026
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.
The
hf jobsCLI is becoming a central workflow tool; without any Jobs API endpoints the Python client errors immediately. This adds a fully-shaped in-memory stub so the CLI andhuggingface_hublibrary work against this server without requiring real compute.Server (Rust)
state.rs—JobsStore(Mutex<HashMap>pair for jobs + scheduled jobs) added toHubStateroutes/jobs.rs— 13 stub handlers; auth-gated, namespace-scoped, correctly shaped JSON responses:POST/GET /api/jobs/{owner},GET /api/jobs/{owner}/{id},POST …/cancel,GET …/logs(SSE),GET …/metrics(SSE)GET /api/jobs/hardware— returns 5 real flavor entries/api/scheduled-jobs/{owner}/…routes/mod.rs— routes wired in;hardwareroute registered before{owner}to avoid collisionQUEUEDstage; cancel transitions toCANCELLED; SSE endpoints return a single stub eventTests
tests/integration/hf_hub/test_jobs_stub_batch7.py— 14 pytest tests using the realhuggingface_hubclient:Tracking
docs/hf_hub_testing_roadmap.md— batch 7 added asplanned; Jobs removed from explicit non-goalsresources/hf_hub_compat/checklist.json— batch 7 entry;jobs→jobs_full_computein non_goalsdocs/feature_support_matrix.md— Jobs/Compute: In Roadmap ✅, status