Conversation
- openai_compat.rs: multi-turn chat against OpenRouter's /chat/completions. No tools are sent, so the model can only answer. Key in the system keychain (openrouter-api-key), never on disk. Clear errors for 401/402/429. Images and text files ride along with the first message; PDFs are not sent. - openrouter_models: public catalogue, text models, free ones first. - Settings -> Chat provider: choose Claude API or OpenRouter, save the key, pick a model (Free only filter). chat_send dispatches on settings.chatProvider; chat_reset clears both histories.
This branch has not been deployed
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
OpenRouter as a second chat provider on Windows and Linux, next to the Claude API. On macOS the chat already supports Google AI and OpenAI; the Tauri build only had Anthropic. OpenRouter gives access to many models through one key, including free ones, which makes the chat usable without an Anthropic API key.
How
openai_compat.rs: a small OpenAI-compatible/chat/completionsclient, built likeclaude.rs:openrouter-api-keyadded toKNOWN_KEYS), never on disk and never in the front end;openrouter_modelscommand: OpenRouter's public catalogue (no key needed), text-output models, free ones first.chat_senddispatches onsettings.chatProvider(default"anthropic", so nothing changes for existing users);chat_resetclears both histories.New settings fields have serde defaults, so older
settings.jsonfiles still load. No new dependency (reqwestandserde_jsonwere already there). Network calls only go to openrouter.ai once the user picks OpenRouter (the model list is fetched when Settings opens).Testing
tsc --noEmit,vite buildandcargo check --releasepass with no new warnings.Screenshots
Settings → Chat provider (taken from my local build; the duplicated "(free) (free)" label and the "KWallet / Secret Service" wording visible there are already fixed in this PR: OpenRouter's free model names already contain "(free)", and the hint now just says "system keychain"):