Align deep-learning client with the API contract - #173
Open
Alvin-Nahabwe wants to merge 16 commits into
Open
Conversation
model training - Add all caret job queue label keys
Longitudinal ml
Fix docker modal blank screen
Add async caret job queue with concurrent
The R client and the FastAPI service were written against different versions of the same contract, and nothing catches the mismatch. Three of those mismatches make calls fail outright: - Training and upload endpoints require an X-API-Key header, which the client never sent. Added an env-configurable dl_request() helper that attaches the key to every state-changing call. DL_API_URL and DL_API_KEY default to the current values, so behaviour is unchanged against an API that does not check the key. - Dataset upload posted the file as `data_zip`; the endpoint requires `data_file`, so uploads were rejected as unprocessable. - Object detection posted `weight_decay`; the endpoint expects `weight_decay_hf`, so the user's weight-decay setting was silently discarded and the default used instead. Also: - The Training History poller registered a new observeEvent on every three-second tick once a job finished, accumulating observers for the life of the session. It now bumps the refresh trigger directly. - .gitignore contained unresolved merge-conflict markers. Resolved them, keeping venv/ and making the static_files rule coherent so the tracked labelling file is still exempt. Verified with parse() on the changed file. The app itself was not run: no R server was available. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 10, 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.
Summary
The R deep-learning client and the FastAPI service have drifted apart — they were written against different versions of the same contract, and nothing catches the mismatch. Three of those mismatches make calls fail outright against the current API:
X-API-Keyon train/uploaddata_zip=@filedata_file=@fileweight_decay=…(obj. detection)weight_decay_hf=…Changes
dl_request()helper that attachesX-API-Keyto every state-changing call (train ×3, upload, inference ×3).DL_API_URLandDL_API_KEYdefault to the current values, so this is a no-op against an API that doesn't check the key — it only fixes things once the key is enforced.data_fileand the object-detection field toweight_decay_hf.observeEventon every 3-second tick, accumulating observers for the life of the session. It now bumps the refresh trigger directly..gitignore, keepingvenv/and making thestatic_filesrule coherent so the tracked labelling file stays exempt.GET endpoints (
/models/list,/data/list,/status,/metrics,/jobs/list,/checkpoints) are unauthenticated in the API and deliberately left without the header.Verification
parse()passes on the changed file. The app was not run — no R server was available in the audit environment. Please exercise upload → train → infer against the API before merging.Follow-ups (not in this PR)
/train/asr, registry lookup, inference) targeting endpoints that no longer exist. Removal is tracked separately.🤖 Generated with Claude Code