Skip to content

feat: add model selection to TUI and CLI - #17

Merged
chenxin-yan merged 9 commits into
mainfrom
feat/model-selection
Apr 18, 2026
Merged

chenxin-yan merged 9 commits into
mainfrom
feat/model-selection

Conversation

@Aleexc12

@Aleexc12 Aleexc12 commented Mar 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds model selection and persistence to the TUI and CLI so users can pick which AI model to use for jobs.

  • TUI model picker (press m) — fetches all providers/models from models.dev/api.json, uses OpenTUI's <select> component
  • ralph model set <provider/model> and ralph model get CLI commands
  • Persists selection to disk via @crustjs/store, passes stored model in job submission payload

What changed

File Change
apps/tui/src/store.ts New — @crustjs/store config, stores model field + parseModelRef() helper
apps/tui/src/cli.ts ralph model set/get commands; daemon submit reads stored model
apps/tui/src/components/app.tsx Model picker via OpenTUI <select>, current model in status bar
apps/tui/package.json @crustjs/store ^0.0.4

Design note

This PR fetches the full model catalog from models.dev/api.json — a static public API. The OpenCode SDK has a client.provider.list() endpoint that returns only connected/authenticated providers, but it requires a running OpenCode server instance. This PR uses the simpler static catalog approach. Filtering to only show models the user has API keys for can be added in the future once a running instance is available to query.

- Add model picker in TUI (press 'm') using OpenTUI <select> component
- Add 'ralph model set/get' CLI commands
- Persist model preference via @crustjs/store
- Attach stored model to job submission payload
- Fetch model catalog from models.dev/api.json
@Aleexc12
Aleexc12 force-pushed the feat/model-selection branch from 1dfee11 to 350f2e7 Compare March 15, 2026 05:26
@Aleexc12
Aleexc12 force-pushed the feat/model-selection branch from a01fef3 to 350f2e7 Compare April 3, 2026 00:00
@chenxin-yan chenxin-yan self-assigned this Apr 17, 2026
@chenxin-yan
chenxin-yan self-requested a review April 17, 2026 22:16
@chenxin-yan chenxin-yan removed their assignment Apr 17, 2026
@chenxin-yan
chenxin-yan requested review from chenxin-yan and removed request for chenxin-yan April 17, 2026 23:06
@chenxin-yan
chenxin-yan merged commit eaef11c into main Apr 18, 2026
1 check passed
@chenxin-yan
chenxin-yan deleted the feat/model-selection branch April 18, 2026 01:38
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.

2 participants