Fix RestClient checkpoint listing and publish/unpublish against Logit…#1
Merged
Merged
Conversation
…s backend The Logits backend diverged from the upstream Tinker schema/routes: - Checkpoint objects are returned with `logits_path` / `size` / `visibility` / `expired_at`, but the upstream `Checkpoint` model requires `tinker_path` and uses `size_bytes` / `public` / `expires_at`. `list_checkpoints` / `list_user_checkpoints` therefore raised APIResponseValidationError. Parse the backend's real field names via `_BackendCheckpoint` and translate back to the upstream `Checkpoint` type so callers keep the documented shape. - The publish/unpublish routes accept only the opaque `chk_...` checkpoint id, but the `logits_path` the backend advertises (and that `save_state` returns) embeds the human-readable checkpoint name. Resolve name -> checkpoint_id via the run's checkpoint list before calling publish (POST) / unpublish (DELETE). Verified end-to-end against api.logits.dev: list_checkpoints, publish and unpublish now work with the documented `logits://<run>/weights/<name>` paths. Adds unit tests for the field translation. Co-Authored-By: Claude Opus 4.8 <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.
…s backend
The Logits backend diverged from the upstream Tinker schema/routes:
Checkpoint objects are returned with
logits_path/size/visibility/expired_at, but the upstreamCheckpointmodel requirestinker_pathand usessize_bytes/public/expires_at.list_checkpoints/list_user_checkpointstherefore raised APIResponseValidationError. Parse the backend's real field names via_BackendCheckpointand translate back to the upstreamCheckpointtype so callers keep the documented shape.The publish/unpublish routes accept only the opaque
chk_...checkpoint id, but thelogits_paththe backend advertises (and thatsave_statereturns) embeds the human-readable checkpoint name. Resolve name -> checkpoint_id via the run's checkpoint list before calling publish (POST) / unpublish (DELETE).Verified end-to-end against api.logits.dev: list_checkpoints, publish and unpublish now work with the documented
logits://<run>/weights/<name>paths. Adds unit tests for the field translation.📋 PR Title Format
The PR title should follow the format:
Where:
typeis one of:feat,fix,docs,refactor,perf,test,chore.scopeis optional and describes the part of the codebase affected (e.g.,auth,ui,api).concise messageis a short description of the change (max 50 chars).📝 Change Type
Please select the type of change this PR introduces (choose one or more):
💡 Description
Briefly describe the change, its purpose, and the problem it solves.
Key Changes
🔗 Related Issues
List any issues this PR closes or relates to:
Closes #123)✅ Checklist
Please ensure the following points are addressed before merging: