Skip to content

Fix for Incomplete OpenRouter Model Listing#179

Closed
OverbearingPearl wants to merge 1 commit intocecli-dev:mainfrom
OverbearingPearl:main
Closed

Fix for Incomplete OpenRouter Model Listing#179
OverbearingPearl wants to merge 1 commit intocecli-dev:mainfrom
OverbearingPearl:main

Conversation

@OverbearingPearl
Copy link
Copy Markdown

Previously, Aider could not display all available models from OpenRouter, causing newer models like openrouter/google/gemini-3-pro-preview to be missing from the /models command output. This issue stemmed from Aider's reliance on static and cached model lists provided by the LiteLLM library, which were often outdated or incomplete.

The fix resolves this by implementing a direct, real-time API call to OpenRouter to fetch its complete and up-to-date model catalog, ensuring all available models are discoverable within Aider.

The Problem: Reliance on Stale and Incomplete Data

Before this change, Aider's mechanism for discovering models had a critical flaw: it had no direct communication channel with OpenRouter to learn about its available models. Instead, it relied on two indirect sources:

  1. LiteLLM's Built-in Model List (litellm.model_cost):

    • Aider uses the LiteLLM library to interface with various LLM providers. LiteLLM includes a hard-coded dictionary of known models.
    • Limitation: This list is static and only updates when the litellm package itself is updated. If OpenRouter added a new model, Aider would remain unaware of it until a new version of LiteLLM was released and integrated.
  2. Cached LiteLLM Model Database:

    • Aider would download and cache a JSON file (model_prices_and_context_window.json) from LiteLLM's GitHub repository.
    • Limitation: This file, also maintained by the LiteLLM team, is not updated in real-time. Furthermore, it does not guarantee the inclusion of every single model available on OpenRouter, especially those with complex routing names.

In essence, Aider was relying on second-hand information that was frequently out of sync with the ground truth at OpenRouter.

The Solution: Direct API Integration

The code modification addresses this root cause by shifting from a passive, cache-based approach to an active, real-time query. This is achieved through three key changes:

  1. Fetching Real-time Data (get_openrouter_models):

    • A new function was introduced that sends a direct HTTP GET request to OpenRouter's official API endpoint: https://openrouter.ai/api/v1/models.
    • This retrieves a definitive list of all models currently served by OpenRouter at the moment of the query.
  2. Dynamic Search Pool Injection (fuzzy_match_models):

    • The fuzzy_match_models function, which powers the model search, was modified to call the new get_openrouter_models function.
    • It then injects the entire list of returned model IDs (prefixed with openrouter/) into the pool of searchable models. This ensures that as soon as OpenRouter adds a new model, Aider can find and use it without requiring a code update.

- Add support for listing available models from OpenRouter
- Implement `get_openrouter_models` to fetch models from the OpenRouter API
@OverbearingPearl OverbearingPearl changed the title Summary Fix for Incomplete OpenRouter Model Listing Nov 22, 2025
@dwash96
Copy link
Copy Markdown
Collaborator

dwash96 commented Nov 22, 2025

As far as I can tell, this wouldn't work to allow a user to actually use a model that's listed in OpenRouter, that's outside of LiteLLM's corpus of models. The data structure in that openrouter api route does not correspond to model_prices_and_context_window.json which declares what a model costs and what it supports. I don't think we need to add the full corpus of OpenRouter in memory.

This PR would be useful if it can match an unknown model name to the OpenRouter model and then use the relevant information from the API to build the underlying Model objects used by LiteLLM. It would work as essentially a fallback, and at that point it might start to obviate/augment the need to copy model_prices_and_context_window.json into model-settings.json as well as keeping pricing and such up to date.

@OverbearingPearl
Copy link
Copy Markdown
Author

Hello @dwash96

Thanks for your review.

Before this change, it works like this:

#### /models openrouter
> Models which match "openrouter":
> - openrouter/anthropic/claude-2
> - openrouter/anthropic/claude-3-5-haiku
> - openrouter/anthropic/claude-3-5-haiku-20241022
> - openrouter/anthropic/claude-3-haiku
> - openrouter/anthropic/claude-3-haiku-20240307
> - openrouter/anthropic/claude-3-opus
> - openrouter/anthropic/claude-3-sonnet
> - openrouter/anthropic/claude-3.5-sonnet
> - openrouter/anthropic/claude-3.5-sonnet:beta
> - openrouter/anthropic/claude-3.7-sonnet
> - openrouter/anthropic/claude-3.7-sonnet:beta
> - openrouter/anthropic/claude-haiku-4.5
> - openrouter/anthropic/claude-instant-v1
> - openrouter/anthropic/claude-opus-4
> - openrouter/anthropic/claude-opus-4.1
> - openrouter/anthropic/claude-sonnet-4
> - openrouter/anthropic/claude-sonnet-4.5
> - openrouter/bytedance/ui-tars-1.5-7b
> - openrouter/cognitivecomputations/dolphin-mixtral-8x7b
> - openrouter/cohere/command-r-plus
> - openrouter/databricks/dbrx-instruct
> - openrouter/deepseek/deepseek-chat
> - openrouter/deepseek/deepseek-chat-v3-0324
> - openrouter/deepseek/deepseek-chat-v3.1
> - openrouter/deepseek/deepseek-coder
> - openrouter/deepseek/deepseek-r1
> - openrouter/deepseek/deepseek-r1-0528
> - openrouter/deepseek/deepseek-v3.2-exp
> - openrouter/fireworks/firellava-13b
> - openrouter/google/gemini-2.0-flash-001
> - openrouter/google/gemini-2.5-flash
> - openrouter/google/gemini-2.5-pro
> - openrouter/google/gemini-pro-1.5
> - openrouter/google/gemini-pro-vision
> - openrouter/google/palm-2-chat-bison
> - openrouter/google/palm-2-codechat-bison
> - openrouter/gryphe/mythomax-l2-13b
> - openrouter/jondurbin/airoboros-l2-70b-2.1
> - openrouter/mancer/weaver
> - openrouter/meta-llama/codellama-34b-instruct
> - openrouter/meta-llama/llama-2-13b-chat
> - openrouter/meta-llama/llama-2-70b-chat
> - openrouter/meta-llama/llama-3-70b-instruct
> - openrouter/meta-llama/llama-3-70b-instruct:nitro
> - openrouter/meta-llama/llama-3-8b-instruct:extended
> - openrouter/meta-llama/llama-3-8b-instruct:free
> - openrouter/microsoft/wizardlm-2-8x22b:nitro
> - openrouter/minimax/minimax-m2
> - openrouter/mistralai/mistral-7b-instruct
> - openrouter/mistralai/mistral-7b-instruct:free
> - openrouter/mistralai/mistral-large
> - openrouter/mistralai/mistral-small-3.1-24b-instruct
> - openrouter/mistralai/mistral-small-3.2-24b-instruct
> - openrouter/mistralai/mixtral-8x22b-instruct
> - openrouter/nousresearch/nous-hermes-llama2-13b
> - openrouter/openai/gpt-3.5-turbo
> - openrouter/openai/gpt-3.5-turbo-16k
> - openrouter/openai/gpt-4
> - openrouter/openai/gpt-4-vision-preview
> - openrouter/openai/gpt-4.1
> - openrouter/openai/gpt-4.1-2025-04-14
> - openrouter/openai/gpt-4.1-mini
> - openrouter/openai/gpt-4.1-mini-2025-04-14
> - openrouter/openai/gpt-4.1-nano
> - openrouter/openai/gpt-4.1-nano-2025-04-14
> - openrouter/openai/gpt-4o
> - openrouter/openai/gpt-4o-2024-05-13
> - openrouter/openai/gpt-5
> - openrouter/openai/gpt-5-chat
> - openrouter/openai/gpt-5-codex
> - openrouter/openai/gpt-5-mini
> - openrouter/openai/gpt-5-nano
> - openrouter/openai/gpt-oss-120b
> - openrouter/openai/gpt-oss-20b
> - openrouter/openai/o1
> - openrouter/openai/o1-mini
> - openrouter/openai/o1-mini-2024-09-12
> - openrouter/openai/o1-preview
> - openrouter/openai/o1-preview-2024-09-12
> - openrouter/openai/o3-mini
> - openrouter/openai/o3-mini-high
> - openrouter/pygmalionai/mythalion-13b
> - openrouter/qwen/qwen-2.5-coder-32b-instruct
> - openrouter/qwen/qwen-vl-plus
> - openrouter/qwen/qwen3-coder
> - openrouter/switchpoint/router
> - openrouter/undi95/remm-slerp-l2-13b
> - openrouter/x-ai/grok-4
> - openrouter/x-ai/grok-4-fast:free
> - openrouter/z-ai/glm-4.6
> - openrouter/z-ai/glm-4.6:exacto

After this change, it looks like this:

#### /models openrouter
> Models which match "openrouter":
> - openrouter/ai21/jamba-large-1.7
> - openrouter/ai21/jamba-mini-1.7
> - openrouter/aion-labs/aion-1.0
> - openrouter/aion-labs/aion-1.0-mini
> - openrouter/aion-labs/aion-rp-llama-3.1-8b
> - openrouter/alfredpros/codellama-7b-instruct-solidity
> - openrouter/alibaba/tongyi-deepresearch-30b-a3b
> - openrouter/alibaba/tongyi-deepresearch-30b-a3b:free
> - openrouter/allenai/olmo-2-0325-32b-instruct
> - openrouter/alpindale/goliath-120b
> - openrouter/amazon/nova-lite-v1
> - openrouter/amazon/nova-micro-v1
> - openrouter/amazon/nova-premier-v1
> - openrouter/amazon/nova-pro-v1
> - openrouter/anthracite-org/magnum-v4-72b
> - openrouter/anthropic/claude-2
> - openrouter/anthropic/claude-3-5-haiku
> - openrouter/anthropic/claude-3-5-haiku-20241022
> - openrouter/anthropic/claude-3-haiku
> - openrouter/anthropic/claude-3-haiku-20240307
> - openrouter/anthropic/claude-3-opus
> - openrouter/anthropic/claude-3-sonnet
> - openrouter/anthropic/claude-3.5-haiku
> - openrouter/anthropic/claude-3.5-haiku-20241022
> - openrouter/anthropic/claude-3.5-sonnet
> - openrouter/anthropic/claude-3.5-sonnet:beta
> - openrouter/anthropic/claude-3.7-sonnet
> - openrouter/anthropic/claude-3.7-sonnet:beta
> - openrouter/anthropic/claude-3.7-sonnet:thinking
> - openrouter/anthropic/claude-haiku-4.5
> - openrouter/anthropic/claude-instant-v1
> - openrouter/anthropic/claude-opus-4
> - openrouter/anthropic/claude-opus-4.1
> - openrouter/anthropic/claude-sonnet-4
> - openrouter/anthropic/claude-sonnet-4.5
> - openrouter/arcee-ai/afm-4.5b
> - openrouter/arcee-ai/coder-large
> - openrouter/arcee-ai/maestro-reasoning
> - openrouter/arcee-ai/spotlight
> - openrouter/arcee-ai/virtuoso-large
> - openrouter/arliai/qwq-32b-arliai-rpr-v1
> - openrouter/arliai/qwq-32b-arliai-rpr-v1:free
> - openrouter/baidu/ernie-4.5-21b-a3b
> - openrouter/baidu/ernie-4.5-21b-a3b-thinking
> - openrouter/baidu/ernie-4.5-300b-a47b
> - openrouter/baidu/ernie-4.5-vl-28b-a3b
> - openrouter/baidu/ernie-4.5-vl-424b-a47b
> - openrouter/bytedance/ui-tars-1.5-7b
> - openrouter/cognitivecomputations/dolphin-mistral-24b-venice-edition:free
> - openrouter/cognitivecomputations/dolphin-mixtral-8x7b
> - openrouter/cohere/command-a
> - openrouter/cohere/command-r-08-2024
> - openrouter/cohere/command-r-plus
> - openrouter/cohere/command-r-plus-08-2024
> - openrouter/cohere/command-r7b-12-2024
> - openrouter/databricks/dbrx-instruct
> - openrouter/deepcogito/cogito-v2-preview-deepseek-671b
> - openrouter/deepcogito/cogito-v2-preview-llama-109b-moe
> - openrouter/deepcogito/cogito-v2-preview-llama-405b
> - openrouter/deepcogito/cogito-v2-preview-llama-70b
> - openrouter/deepcogito/cogito-v2.1-671b
> - openrouter/deepseek/deepseek-chat
> - openrouter/deepseek/deepseek-chat-v3-0324
> - openrouter/deepseek/deepseek-chat-v3-0324:free
> - openrouter/deepseek/deepseek-chat-v3.1
> - openrouter/deepseek/deepseek-chat:free
> - openrouter/deepseek/deepseek-coder
> - openrouter/deepseek/deepseek-prover-v2
> - openrouter/deepseek/deepseek-r1
> - openrouter/deepseek/deepseek-r1-0528
> - openrouter/deepseek/deepseek-r1-0528-qwen3-8b
> - openrouter/deepseek/deepseek-r1-0528-qwen3-8b:free
> - openrouter/deepseek/deepseek-r1-0528:free
> - openrouter/deepseek/deepseek-r1-distill-llama-70b
> - openrouter/deepseek/deepseek-r1-distill-llama-70b:free
> - openrouter/deepseek/deepseek-r1-distill-qwen-14b
> - openrouter/deepseek/deepseek-r1-distill-qwen-32b
> - openrouter/deepseek/deepseek-r1:free
> - openrouter/deepseek/deepseek-v3.1-terminus
> - openrouter/deepseek/deepseek-v3.1-terminus:exacto
> - openrouter/deepseek/deepseek-v3.2-exp
> - openrouter/eleutherai/llemma_7b
> - openrouter/fireworks/firellava-13b
> - openrouter/google/gemini-2.0-flash-001
> - openrouter/google/gemini-2.0-flash-exp:free
> - openrouter/google/gemini-2.0-flash-lite-001
> - openrouter/google/gemini-2.5
> - openrouter/google/gemini-2.5-flash
> - openrouter/google/gemini-2.5-flash-image
> - openrouter/google/gemini-2.5-flash-image-preview
> - openrouter/google/gemini-2.5-flash-lite
> - openrouter/google/gemini-2.5-flash-lite-preview-09-2025
> - openrouter/google/gemini-2.5-flash-preview-09-2025
> - openrouter/google/gemini-2.5-pro
> - openrouter/google/gemini-2.5-pro-exp-03-25
> - openrouter/google/gemini-2.5-pro-preview
> - openrouter/google/gemini-2.5-pro-preview-03-25
> - openrouter/google/gemini-2.5-pro-preview-05-06
> - openrouter/google/gemini-3-pro-image-preview
> - openrouter/google/gemini-3-pro-preview
> - openrouter/google/gemini-pro-1.5
> - openrouter/google/gemini-pro-vision
> - openrouter/google/gemma-2-27b-it
> - openrouter/google/gemma-2-9b-it
> - openrouter/google/gemma-3-12b-it
> - openrouter/google/gemma-3-12b-it:free
> - openrouter/google/gemma-3-27b-it
> - openrouter/google/gemma-3-27b-it:free
> - openrouter/google/gemma-3-4b-it
> - openrouter/google/gemma-3-4b-it:free
> - openrouter/google/gemma-3n-e2b-it:free
> - openrouter/google/gemma-3n-e4b-it
> - openrouter/google/gemma-3n-e4b-it:free
> - openrouter/google/palm-2-chat-bison
> - openrouter/google/palm-2-codechat-bison
> - openrouter/gryphe/mythomax-l2-13b
> - openrouter/ibm-granite/granite-4.0-h-micro
> - openrouter/inception/mercury
> - openrouter/inception/mercury-coder
> - openrouter/inflection/inflection-3-pi
> - openrouter/inflection/inflection-3-productivity
> - openrouter/jondurbin/airoboros-l2-70b-2.1
> - openrouter/kwaipilot/kat-coder-pro:free
> - openrouter/liquid/lfm-2.2-6b
> - openrouter/liquid/lfm2-8b-a1b
> - openrouter/mancer/weaver
> - openrouter/meituan/longcat-flash-chat
> - openrouter/meituan/longcat-flash-chat:free
> - openrouter/meta-llama/codellama-34b-instruct
> - openrouter/meta-llama/llama-2-13b-chat
> - openrouter/meta-llama/llama-2-70b-chat
> - openrouter/meta-llama/llama-3-70b-instruct
> - openrouter/meta-llama/llama-3-70b-instruct:nitro
> - openrouter/meta-llama/llama-3-8b-instruct
> - openrouter/meta-llama/llama-3-8b-instruct:extended
> - openrouter/meta-llama/llama-3-8b-instruct:free
> - openrouter/meta-llama/llama-3.1-405b
> - openrouter/meta-llama/llama-3.1-405b-instruct
> - openrouter/meta-llama/llama-3.1-70b-instruct
> - openrouter/meta-llama/llama-3.1-8b-instruct
> - openrouter/meta-llama/llama-3.2-11b-vision-instruct
> - openrouter/meta-llama/llama-3.2-1b-instruct
> - openrouter/meta-llama/llama-3.2-3b-instruct
> - openrouter/meta-llama/llama-3.2-3b-instruct:free
> - openrouter/meta-llama/llama-3.2-90b-vision-instruct
> - openrouter/meta-llama/llama-3.3-70b-instruct
> - openrouter/meta-llama/llama-3.3-70b-instruct:free
> - openrouter/meta-llama/llama-4-maverick
> - openrouter/meta-llama/llama-4-scout
> - openrouter/meta-llama/llama-guard-2-8b
> - openrouter/meta-llama/llama-guard-3-8b
> - openrouter/meta-llama/llama-guard-4-12b
> - openrouter/microsoft/mai-ds-r1
> - openrouter/microsoft/mai-ds-r1:free
> - openrouter/microsoft/phi-3-medium-128k-instruct
> - openrouter/microsoft/phi-3-mini-128k-instruct
> - openrouter/microsoft/phi-3.5-mini-128k-instruct
> - openrouter/microsoft/phi-4
> - openrouter/microsoft/phi-4-multimodal-instruct
> - openrouter/microsoft/phi-4-reasoning-plus
> - openrouter/microsoft/wizardlm-2-8x22b
> - openrouter/microsoft/wizardlm-2-8x22b:nitro
> - openrouter/minimax/minimax-01
> - openrouter/minimax/minimax-m1
> - openrouter/minimax/minimax-m2
> - openrouter/mistralai/codestral-2501
> - openrouter/mistralai/codestral-2508
> - openrouter/mistralai/devstral-medium
> - openrouter/mistralai/devstral-small
> - openrouter/mistralai/devstral-small-2505
> - openrouter/mistralai/magistral-medium-2506
> - openrouter/mistralai/magistral-medium-2506:thinking
> - openrouter/mistralai/magistral-small-2506
> - openrouter/mistralai/ministral-3b
> - openrouter/mistralai/ministral-8b
> - openrouter/mistralai/mistral-7b-instruct
> - openrouter/mistralai/mistral-7b-instruct-v0.1
> - openrouter/mistralai/mistral-7b-instruct-v0.2
> - openrouter/mistralai/mistral-7b-instruct-v0.3
> - openrouter/mistralai/mistral-7b-instruct:free
> - openrouter/mistralai/mistral-large
> - openrouter/mistralai/mistral-large-2407
> - openrouter/mistralai/mistral-large-2411
> - openrouter/mistralai/mistral-medium-3
> - openrouter/mistralai/mistral-medium-3.1
> - openrouter/mistralai/mistral-nemo
> - openrouter/mistralai/mistral-nemo:free
> - openrouter/mistralai/mistral-saba
> - openrouter/mistralai/mistral-small
> - openrouter/mistralai/mistral-small-24b-instruct-2501
> - openrouter/mistralai/mistral-small-24b-instruct-2501:free
> - openrouter/mistralai/mistral-small-3.1-24b-instruct
> - openrouter/mistralai/mistral-small-3.1-24b-instruct:free
> - openrouter/mistralai/mistral-small-3.2-24b-instruct
> - openrouter/mistralai/mistral-small-3.2-24b-instruct:free
> - openrouter/mistralai/mistral-tiny
> - openrouter/mistralai/mixtral-8x22b-instruct
> - openrouter/mistralai/mixtral-8x7b-instruct
> - openrouter/mistralai/pixtral-12b
> - openrouter/mistralai/pixtral-large-2411
> - openrouter/mistralai/voxtral-small-24b-2507
> - openrouter/moonshotai/kimi-dev-72b
> - openrouter/moonshotai/kimi-k2
> - openrouter/moonshotai/kimi-k2-0905
> - openrouter/moonshotai/kimi-k2-0905:exacto
> - openrouter/moonshotai/kimi-k2-thinking
> - openrouter/moonshotai/kimi-k2:free
> - openrouter/moonshotai/kimi-linear-48b-a3b-instruct
> - openrouter/morph/morph-v3-fast
> - openrouter/morph/morph-v3-large
> - openrouter/neversleep/llama-3.1-lumimaid-8b
> - openrouter/neversleep/noromaid-20b
> - openrouter/nousresearch/deephermes-3-mistral-24b-preview
> - openrouter/nousresearch/hermes-2-pro-llama-3-8b
> - openrouter/nousresearch/hermes-3-llama-3.1-405b
> - openrouter/nousresearch/hermes-3-llama-3.1-405b:free
> - openrouter/nousresearch/hermes-3-llama-3.1-70b
> - openrouter/nousresearch/hermes-4-405b
> - openrouter/nousresearch/hermes-4-70b
> - openrouter/nousresearch/nous-hermes-llama2-13b
> - openrouter/nvidia/llama-3.1-nemotron-70b-instruct
> - openrouter/nvidia/llama-3.1-nemotron-ultra-253b-v1
> - openrouter/nvidia/llama-3.3-nemotron-super-49b-v1.5
> - openrouter/nvidia/nemotron-nano-12b-v2-vl
> - openrouter/nvidia/nemotron-nano-12b-v2-vl:free
> - openrouter/nvidia/nemotron-nano-9b-v2
> - openrouter/nvidia/nemotron-nano-9b-v2:free
> - openrouter/openai/chatgpt-4o-latest
> - openrouter/openai/codex-mini
> - openrouter/openai/gpt-3.5-turbo
> - openrouter/openai/gpt-3.5-turbo-0613
> - openrouter/openai/gpt-3.5-turbo-16k
> - openrouter/openai/gpt-3.5-turbo-instruct
> - openrouter/openai/gpt-4
> - openrouter/openai/gpt-4-0314
> - openrouter/openai/gpt-4-1106-preview
> - openrouter/openai/gpt-4-turbo
> - openrouter/openai/gpt-4-turbo-preview
> - openrouter/openai/gpt-4-vision-preview
> - openrouter/openai/gpt-4.1
> - openrouter/openai/gpt-4.1-mini
> - openrouter/openai/gpt-4.1-nano
> - openrouter/openai/gpt-4o
> - openrouter/openai/gpt-4o-2024-05-13
> - openrouter/openai/gpt-4o-2024-08-06
> - openrouter/openai/gpt-4o-2024-11-20
> - openrouter/openai/gpt-4o-audio-preview
> - openrouter/openai/gpt-4o-mini
> - openrouter/openai/gpt-4o-mini-2024-07-18
> - openrouter/openai/gpt-4o-mini-search-preview
> - openrouter/openai/gpt-4o-search-preview
> - openrouter/openai/gpt-4o:extended
> - openrouter/openai/gpt-5
> - openrouter/openai/gpt-5-chat
> - openrouter/openai/gpt-5-codex
> - openrouter/openai/gpt-5-image
> - openrouter/openai/gpt-5-image-mini
> - openrouter/openai/gpt-5-mini
> - openrouter/openai/gpt-5-nano
> - openrouter/openai/gpt-5-pro
> - openrouter/openai/gpt-5.1
> - openrouter/openai/gpt-5.1-chat
> - openrouter/openai/gpt-5.1-codex
> - openrouter/openai/gpt-5.1-codex-mini
> - openrouter/openai/gpt-oss-120b
> - openrouter/openai/gpt-oss-120b:exacto
> - openrouter/openai/gpt-oss-20b
> - openrouter/openai/gpt-oss-20b:free
> - openrouter/openai/gpt-oss-safeguard-20b
> - openrouter/openai/o1
> - openrouter/openai/o1-mini
> - openrouter/openai/o1-mini-2024-09-12
> - openrouter/openai/o1-preview
> - openrouter/openai/o1-preview-2024-09-12
> - openrouter/openai/o1-pro
> - openrouter/openai/o3
> - openrouter/openai/o3-deep-research
> - openrouter/openai/o3-mini
> - openrouter/openai/o3-mini-high
> - openrouter/openai/o3-pro
> - openrouter/openai/o4-mini
> - openrouter/openai/o4-mini-deep-research
> - openrouter/openai/o4-mini-high
> - openrouter/opengvlab/internvl3-78b
> - openrouter/openrouter/auto
> - openrouter/openrouter/optimus-alpha
> - openrouter/openrouter/quasar-alpha
> - openrouter/perplexity/sonar
> - openrouter/perplexity/sonar-deep-research
> - openrouter/perplexity/sonar-pro
> - openrouter/perplexity/sonar-pro-search
> - openrouter/perplexity/sonar-reasoning
> - openrouter/perplexity/sonar-reasoning-pro
> - openrouter/pygmalionai/mythalion-13b
> - openrouter/qwen/qwen-2.5-72b-instruct
> - openrouter/qwen/qwen-2.5-72b-instruct:free
> - openrouter/qwen/qwen-2.5-7b-instruct
> - openrouter/qwen/qwen-2.5-coder-32b-instruct
> - openrouter/qwen/qwen-2.5-coder-32b-instruct:free
> - openrouter/qwen/qwen-2.5-vl-7b-instruct
> - openrouter/qwen/qwen-max
> - openrouter/qwen/qwen-plus
> - openrouter/qwen/qwen-plus-2025-07-28
> - openrouter/qwen/qwen-plus-2025-07-28:thinking
> - openrouter/qwen/qwen-turbo
> - openrouter/qwen/qwen-vl-max
> - openrouter/qwen/qwen-vl-plus
> - openrouter/qwen/qwen2.5-coder-7b-instruct
> - openrouter/qwen/qwen2.5-vl-32b-instruct
> - openrouter/qwen/qwen2.5-vl-32b-instruct:free
> - openrouter/qwen/qwen2.5-vl-72b-instruct
> - openrouter/qwen/qwen3-14b
> - openrouter/qwen/qwen3-14b:free
> - openrouter/qwen/qwen3-235b-a22b
> - openrouter/qwen/qwen3-235b-a22b-2507
> - openrouter/qwen/qwen3-235b-a22b-thinking-2507
> - openrouter/qwen/qwen3-235b-a22b:free
> - openrouter/qwen/qwen3-30b-a3b
> - openrouter/qwen/qwen3-30b-a3b-instruct-2507
> - openrouter/qwen/qwen3-30b-a3b-thinking-2507
> - openrouter/qwen/qwen3-30b-a3b:free
> - openrouter/qwen/qwen3-32b
> - openrouter/qwen/qwen3-4b:free
> - openrouter/qwen/qwen3-8b
> - openrouter/qwen/qwen3-coder
> - openrouter/qwen/qwen3-coder-30b-a3b-instruct
> - openrouter/qwen/qwen3-coder-flash
> - openrouter/qwen/qwen3-coder-plus
> - openrouter/qwen/qwen3-coder:exacto
> - openrouter/qwen/qwen3-coder:free
> - openrouter/qwen/qwen3-max
> - openrouter/qwen/qwen3-next-80b-a3b-instruct
> - openrouter/qwen/qwen3-next-80b-a3b-thinking
> - openrouter/qwen/qwen3-vl-235b-a22b-instruct
> - openrouter/qwen/qwen3-vl-235b-a22b-thinking
> - openrouter/qwen/qwen3-vl-30b-a3b-instruct
> - openrouter/qwen/qwen3-vl-30b-a3b-thinking
> - openrouter/qwen/qwen3-vl-8b-instruct
> - openrouter/qwen/qwen3-vl-8b-thinking
> - openrouter/qwen/qwq-32b
> - openrouter/raifle/sorcererlm-8x22b
> - openrouter/relace/relace-apply-3
> - openrouter/sao10k/l3-euryale-70b
> - openrouter/sao10k/l3-lunaris-8b
> - openrouter/sao10k/l3.1-70b-hanami-x1
> - openrouter/sao10k/l3.1-euryale-70b
> - openrouter/sao10k/l3.3-euryale-70b
> - openrouter/stepfun-ai/step3
> - openrouter/switchpoint/router
> - openrouter/tencent/hunyuan-a13b-instruct
> - openrouter/thedrummer/anubis-70b-v1.1
> - openrouter/thedrummer/cydonia-24b-v4.1
> - openrouter/thedrummer/rocinante-12b
> - openrouter/thedrummer/skyfall-36b-v2
> - openrouter/thedrummer/unslopnemo-12b
> - openrouter/thudm/glm-4.1v-9b-thinking
> - openrouter/tngtech/deepseek-r1t-chimera
> - openrouter/tngtech/deepseek-r1t-chimera:free
> - openrouter/tngtech/deepseek-r1t2-chimera
> - openrouter/tngtech/deepseek-r1t2-chimera:free
> - openrouter/undi95/remm-slerp-l2-13b
> - openrouter/x-ai/grok-3
> - openrouter/x-ai/grok-3-beta
> - openrouter/x-ai/grok-3-fast-beta
> - openrouter/x-ai/grok-3-mini
> - openrouter/x-ai/grok-3-mini-beta
> - openrouter/x-ai/grok-3-mini-fast-beta
> - openrouter/x-ai/grok-4
> - openrouter/x-ai/grok-4-fast
> - openrouter/x-ai/grok-4.1-fast
> - openrouter/x-ai/grok-4.1-fast:free
> - openrouter/x-ai/grok-code-fast-1
> - openrouter/z-ai/glm-4-32b
> - openrouter/z-ai/glm-4.5
> - openrouter/z-ai/glm-4.5-air
> - openrouter/z-ai/glm-4.5-air:free
> - openrouter/z-ai/glm-4.5v
> - openrouter/z-ai/glm-4.6
> - openrouter/z-ai/glm-4.6:exacto

How do you think about it?

@OverbearingPearl
Copy link
Copy Markdown
Author

By the way, I couldn't get the motivation about model_prices_and_context_window.json
and model-settings.json. Could you please kindly give some more details?

@dwash96
Copy link
Copy Markdown
Collaborator

dwash96 commented Nov 27, 2025

By the way, I couldn't get the motivation about model_prices_and_context_window.json and model-settings.json. Could you please kindly give some more details?

Yes, the information on the default models allowed by the system ate maintained in:
https://github.com/dwash96/aider-ce/blob/main/aider/resources/model-metadata.json
and
https://github.com/dwash96/aider-ce/blob/main/aider/resources/model-settings.yml

Because aider is heavily built over LiteLLM, the above model-metadata.json file is actually a ripped version of:
https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json

These are the only identifiers the system will recognize as valid model names. It is technically possible to specify custom models per:
https://aider.chat/docs/config/adv-model-settings.html

What I would recommend for this kind of PR is to essentially be able to do this automatically for openrouter models based on what is returned in the openrouter API and the format present in the model-metadata.json file. Basically, instead of storing every possible model in an incompatible format like this PR does currently, use the openrouter API to actually configure models that are not present in the metadata

@OverbearingPearl
Copy link
Copy Markdown
Author

@dwash96

What I would recommend for this kind of PR is to essentially be able
to do this automatically for openrouter models based on what is
returned in the openrouter API and the format present in the
model-metadata.json file. Basically, instead of storing every possible
model in an incompatible format like this PR does currently, use the
openrouter API to actually configure models that are not present in
the metadata

Oh great! Thank you so much.

I'll try to make that.

@OverbearingPearl
Copy link
Copy Markdown
Author

The model I needed (Gemini-3) has been added by other as @dwash96 mentioned.

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