Add favorite models and pricing to model selector#21
Open
GSmithBoltz wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Fable 5 <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.
What
Two related improvements to the model selection sheet (used by both the chat top bar and the Settings default-model picker):
Favorite models — each model row now has a star toggle. Favorited models are pinned to the top of the list (and stay on top within search results). Favorites are persisted in MMKV (
favorite_modelskey) and exposed as aFlowfromModelRepository, so both screens stay in sync live — same pattern as the font-size settings.Per-model pricing — the sheet now shows OpenRouter input/output token cost on each row, e.g.
deepseek-v4-pro $0.44/M in | $0.87/M out. Free models showFree; models with dynamic pricing (e.g.openrouter/auto, which reports-1) show nothing. To get pricing,getModels()now fetches/api/v1/modelsdirectly with ktor and parses it with kotlinx.serialization instead of going through the openai-kotlin client, which drops thepricingfield. Side benefit: the models list loads even before an API key is set, since the endpoint is public.Implementation notes
ktor-client-corein:data(version managed by the existing openai-client BOM, same as the already-presentktor-client-okhttp).Model/ModelEntitygain nullableinputPricePerMillion/outputPricePerMillionfields with defaults, so previously stored default-model JSON still deserializes fine.basicscomponents (IconButton,Icon,Text), mirroring the star pattern fromChatOptions.Testing
:app:compileDebugKotlin,testDebugUnitTest, and:app:assembleDebugall pass.ktlintCheckpasses for:domain,:data, and:app. The:uicheck reports only violations that already exist on master (Slider.kt,MessageBubble.kt,SettingsScreen.ktimport order) — this change adds none.Screenshot
🤖 Generated with Claude Code