Skip to content

Conversation

@irthomasthomas
Copy link

Implement persistent storage for OpenRouter model configurations using SQLite. This allows users to save specific combinations of model options (e.g., provider settings, online mode) under custom aliases for easy reuse.

Key changes:

  • Introduce database functions (save_config, get_config, etc.) and schema for storing configurations.
  • Add CLI commands openrouter save, openrouter list-saved, and openrouter remove-saved to manage saved aliases.
  • Modify model registration to load saved configurations and register them as distinct models identifiable by their alias.
  • Update model classes to apply saved options when building API requests, allowing prompt-specific options to override saved ones.
llm openrouter save openrouter/meta-llama/llama-4-scout \
    --name scout-groq-online \
    -o provider '{"order":["Groq"],"allow_fallbacks":true}' \
    -o online 1

To use:

llm -m scout-groq-online "what is the knowledge cutoff date of 'gemini-2.5'"

According to x.com, the training data cut off for Gemini 2.5 Pro is March 2025.

These can now be used in a consortium:

llm openrouter save openrouter/google/gemini-2.5-pro-preview-03-25 --name gemini-2.5-t0 -o provider '{                                                            
 "order": [
    "Google AI Studio"
  ],
"allow_fallbacks": false
}' -o temperature 0
llm openrouter save openrouter/google/gemini-2.5-pro-preview-03-25 --name gemini-2.5-t2 -o provider '{
  "order": [
    "Google AI Studio"
  ],
"allow_fallbacks": false
}' -o temperature 2
llm consortium save -m scout-groq-online -m gemini-2.5-t0 -m gemini-2.5-t2 \
--arbiter gemini-2.5-t0 \
groq-gemini-online
llm -m groq-gemini-online "Create a comprehensive UV cheatsheet. Highlight new UV features for 2024 and 2025 including a link to the announcement or docs."

irthomasthomas and others added 2 commits April 9, 2025 01:04
Implement persistent storage for OpenRouter model configurations using SQLite. This allows users to save specific combinations of model options (e.g., provider settings, online mode) under custom aliases for easy reuse.

Key changes:
- Introduce database functions (`save_config`, `get_config`, etc.) and schema for storing configurations.
- Add CLI commands `openrouter save`, `openrouter list-saved`, and `openrouter remove-saved` to manage saved aliases.
- Modify model registration to load saved configurations and register them as distinct models identifiable by their alias.
- Update model classes to apply saved options when building API requests, allowing prompt-specific options to override saved ones.
This commit refactors the display of the `architecture` field in the output of the `llm openrouter models` command.

Previously, the architecture display was incomplete and could result in extra spaces. This change iterates through the architecture values:
- If a value is a list, it's now joined into a comma-separated string.
- Non-list truthy values are included as strings.
- Only includes the `architecture` line if there are values to display.

This provides a more accurate and readable representation of the model architecture.
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