Fetch dynamic provider model lists across LLM proxy, desktop, GPUI, and mobile

CO
16h ago
+4830-156

Summary

Context: Anarlog Pro and BYOK provider model selectors across apps/desktop, apps/desktop-gpui, apps/mobile, and crates/llm-proxy relied heavily on hardcoded model lists for Anarlog Pro, Vertex AI, Cloudflare Workers AI, and several remote STT providers, requiring app releases whenever upstream providers added or retired models.

Intention: Fetch live model lists dynamically from upstream provider endpoints and GET /llm/models while preserving curated fallbacks, request timeouts, response size limits, and capability filtering.

Direction:

  • Expose GET /llm/models on crates/llm-proxy (returning the configured Anarlog Pro ModelEntry catalog with curated labels/modalities) and regenerate apps/api/openapi.gen.json and @anlg/api-client.
  • Wire live discovery for Anarlog Pro (/llm/models), Google Vertex AI (/publishers/google/models), Cloudflare Workers AI (/models/search), and listable remote STT providers across apps/desktop, apps/desktop-gpui, and apps/mobile, merging discovered models with curated fallback entries without blocking readiness.

Demo

N/A: backend endpoint, OpenAPI schema, and non-blocking async model discovery verified via unit tests and wiremock/node/Vitest harnesses.

Verification

Local checks run in /Users/johnjeong/.t3/worktrees/anarlog/fix-db-cd-remote-push-e0214c7b6dfa13dc (mise Node v22.23.4, Rust 1.98.1):

  • pnpm exec dprint check --allow-no-files across all changed files: passed.
  • python3 .github/scripts/test_check_license_boundary.py && python3 .github/scripts/check_license_boundary.py: passed (9 tests + license boundary passed).
  • RUSTUP_TOOLCHAIN=1.98.1 cargo check --locked -p api: passed.
  • RUSTUP_TOOLCHAIN=1.98.1 cargo test --locked -p llm-proxy: passed (7 lib + 4 replay; 2 ignored E2E).
  • pnpm -F @anlg/desktop typecheck && pnpm -F @anlg/mobile typecheck: passed.
  • pnpm -F @anlg/desktop exec vitest run src/settings/ai/shared/anarlog-pro-models.test.ts src/settings/ai/shared/list-cloudflare-workers-ai.test.ts src/settings/ai/shared/list-google-vertex-ai.test.ts src/settings/ai/stt/list-models.test.ts src/settings/ai/stt/select.test.tsx: passed (5 files, 18 tests); prior full vitest run (505 files) also passed. Pre-existing @tanstack/query/exhaustive-deps ESLint error in apps/desktop/src/settings/ai/llm/select.tsx:228 is unchanged from main.
  • pnpm exec oxlint --quiet --format=github apps/desktop/src/: passed (0 errors, 226 warnings).
  • node --test apps/mobile/src/settings/settings-runtime.test.mjs: passed (76/76 tests).
  • apps/desktop-gpui: cargo fmt --check, cargo test --locked --workspace (647 lib + 17 a11y + dictation_capture + 14 screens), and cargo clippy --locked --workspace --all-targets --no-deps -- -D warnings: passed.

Summary by cubic

Replaces hardcoded provider model lists with live model discovery so model pickers in the desktop, GPUI, and mobile apps pick up new and retired upstream models without needing app releases.

Model selectors now fetch models from upstream provider endpoints and the LLM proxy, merging results with curated fallback lists without blocking readiness. Discovery requests carry timeouts and response size limits, and non-chat models are filtered out. OpenAI transcription mode was narrowed so only gpt-live-transcribe counts as live.

New Features

  • Adds authenticated, rate-limited GET /llm/models to crates/llm-proxy and regenerates the OpenAPI schema and @anlg/api-client.
  • Fetches live models for Anarlog Pro, Google Vertex AI, Cloudflare Workers AI, and listable remote STT providers across apps/desktop, apps/desktop-gpui, and apps/mobile.