feat: add api-asset-client crate and use for all model download URLs#4067
Draft
feat: add api-asset-client crate and use for all model download URLs#4067
Conversation
Introduces a new `api-asset-client` crate to resolve model asset URLs from the Hyprnote API, falling back to hardcoded URLs when the API is unavailable. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Deploy Preview for hyprnote-storybook canceled.
|
✅ Deploy Preview for hyprnote canceled.
|
Co-Authored-By: yujonglee <yujonglee.dev@gmail.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.
Summary
api-asset-clientcrate that fetches model asset metadata (URL, checksum, size) fromhttps://api.hyprnote.com/v1/assets/modelsOnceCellto avoid repeated network calls; exposes aresolve_modelconvenience function via a global default clientlocal-sttplugin to resolve model download URLs from the API, falling back to the hardcodedtar_url/model_urlif the API call failslocal-llmplugin to resolve model download URLs from the API, with the same fallback patternamcrate'sdownloadmethod to resolve URLs from the API instead of using hardcoded S3 URLs directlystrum::Displayderive tolocal-llm::SupportedModelto enableto_string()for asset ID resolutionReview & Testing Checklist for Human
to_string()on each model enum (AmModel,WhisperModel,SupportedModel) match the IDs returned byhttps://api.hyprnote.com/v1/assets/models. EspeciallySupportedModelvariants (Llama3p2_3bQ4,Gemma3_4bQ4,HyprLLM) which use default strum Display without custom serializationam::downloadbeing called fromlocal-stt::extdoesn't double-resolve (currentlylocal-sttdoes its own resolution and doesn't callam::download, so this should be fine)Notes
Requested by: @yujonglee
Link to Devin run