Skip to content

Comments

feat: add api-asset-client crate and /v1/assets/models API endpoint#4067

Draft
yujonglee wants to merge 4 commits intomainfrom
feat/api-asset-client
Draft

feat: add api-asset-client crate and /v1/assets/models API endpoint#4067
yujonglee wants to merge 4 commits intomainfrom
feat/api-asset-client

Conversation

@yujonglee
Copy link
Contributor

@yujonglee yujonglee commented Feb 18, 2026

Summary

  • Adds a new api-asset-client crate that fetches model asset metadata (URL, checksum, size) from https://api.hyprnote.com/v1/assets/models
  • Uses a cached OnceCell to avoid repeated network calls; exposes a resolve_model convenience function via a global default client
  • Updates local-stt plugin to resolve model download URLs from the API, falling back to the hardcoded tar_url/model_url if the API call fails
  • Updates local-llm plugin to resolve model download URLs from the API, with the same fallback pattern
  • Updates am crate's download method to resolve URLs from the API instead of using hardcoded S3 URLs directly
  • Adds strum::Display derive to local-llm::SupportedModel to enable to_string() for asset ID resolution
  • Adds a new api-asset crate that serves GET /models with the full model manifest (13 models across AmModel, WhisperModel, SupportedModel)
  • Wires up the endpoint in apps/api at /v1/assets/models (no auth required, as clients need this pre-authentication)

Review & Testing Checklist for Human

  • Asset ID correctness: Verify that every id in crates/api-asset/src/lib.rs exactly matches the to_string() output of the corresponding model enum variant. Especially SupportedModel variants (Llama3p2_3bQ4, Gemma3_4bQ4, HyprLLM) which use default strum Display (no custom serialization)
  • Data duplication: The URLs, checksums, and sizes in api-asset are hardcoded copies from am/src/model.rs, whisper-local-model/src/lib.rs, and local-llm/src/model.rs. Verify all 13 entries match their source. If any source values have changed on main since this branch, the API data is stale
  • Dual ModelAsset definition: api-asset (server) and api-asset-client (client) each define their own ModelAsset struct with the same shape — confirm the field names/types match so serialization round-trips correctly
  • Test end-to-end: Deploy the API, hit GET /v1/assets/models, then test model downloads for each plugin (local-stt, local-llm, am) against the live endpoint
  • Fallback path: Test model downloads when the API is unreachable to confirm fallback to hardcoded URLs still works

Notes

The /v1/assets/models endpoint is unauthenticated — this is intentional since desktop clients call it before auth. The checksum field is u32 in both server and client; note that SupportedModel::model_checksum() returns u64 (current values fit in u32 but this could diverge).

Requested by: @yujonglee
Link to Devin run

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>
@netlify
Copy link

netlify bot commented Feb 18, 2026

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 4b16178
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/699695459fa54a0009ba906d
😎 Deploy Preview https://deploy-preview-4067--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 18, 2026

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 4b16178
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6996954542939400087c1007
😎 Deploy Preview https://deploy-preview-4067--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title feat: add api-asset-client crate and use for model download URLs feat: add api-asset-client crate and use for all model download URLs Feb 18, 2026
…pps/api

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title feat: add api-asset-client crate and use for all model download URLs feat: add api-asset-client crate and /v1/assets/models API endpoint Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant