Repository navigation
[FEATURE]: Add LiteLLM as a provider #48938
Description
Activity
github-actions commented
on Sep 14, 2026 on Sep 14, 2026 – with GitHub ActionsContributorMore actionsThis issue might be a duplicate of existing issues. Please check:
- feat: add LiteLLM provider support #22212: Same feature request — add LiteLLM as a built-in provider using an OpenAI-compatible adapter (this issue explicitly references it as a prior request)
If this is intentionally a re-open of that closed issue, please link it clearly and explain what has changed or why it was re-opened, so maintainers have the full context.
Seem like a no-brainer to have a provider which can consume LiteLLM’s
/model/infometadata to get limits, costs, modalities, and capabilities. It seemed like PR 8359 addresses this and got stalled so I investigated:What Happened
- PR feat(opencode): add auto model detection for OpenAI-compatible providers #8359 (feat(opencode): add auto model detection for OpenAI-compatible providers #8359) initially implemented GET {baseURL}/models for @ai-sdk/openai-compatible providers.
- During review, several design questions appeared:
- Should discovery be automatic or opt-in?
- Should the endpoint merely add models, or filter Models.dev to the models the account can access?
- How should authenticated endpoints be queried?
- How long may discovery delay startup?
- What happens when /models provides only an ID and no limits or capabilities?
- The implementation caused an E2E problem because OpenCode’s own endpoint exposed additional models. A test selected an unexpected model and was denied. The immediate workaround was to skip discovery for the opencode provider.
- On January 30, 2026, maintainer rekram1-node merged it into models-endpoint, not dev, saying:
“Merging into a separate branch that I'll play with for a bit and see if tweaks are needed” - That branch then received two commits named wip. One changed discovery toward filtering known models and left adding unknown endpoint models unfinished.
- PR add models endpoint #13234 (add models endpoint #13234) was opened to merge models-endpoint into dev. It received no maintainer review and became increasingly stale.
- On May 15, PR add models endpoint #13234 was automatically closed because it was older than one month and had fewer than two positive reactions.
Why It Stalled
The fundamental issue was that /v1/models discovery solves only part of the problem.
The standard response usually provides:{ "id": "model-name", "object": "model", "owned_by": "..." }That does not provide the information OpenCode relies on for:
- Context and output limits
- Costs
- Vision and PDF support
- Reasoning capabilities
- Tool support
- Temperature support
- Provider-specific transport behavior
That deficiency was explicitly raised on both #8359 and #13234. It is exactly why generic discovery would not have removed your need for the /.well-known/ metadata.
Other unresolved concerns were:
- Whether inaccessible Models.dev models should be hidden
- Whether configured models should survive if discovery fails
- Authentication availability during config/provider initialization
- Startup delays from unreachable endpoints
- Automatic outbound requests to arbitrary custom URLs
- Unknown models receiving context: 0, output: 0, and conservative capability default
There Were Follow-Ups
Notable examples:
- feat(opencode): add LiteLLM provider with auto model discovery #14468 (feat(opencode): add LiteLLM provider with auto model discovery #14468): native LiteLLM provider using /model/info
This was the closest match to your requirement. It mapped pricing, limits, reasoning, vision, PDF, tools, and other metadata. Tests were fixed, but it sat without substantive maintainer review for about five months. The author eventually closed it with “I'm tired.” A LiteLLM security incident was mentioned during that period, but there is no maintainer statement establishing it as the reason the PR was not merged. - feat(opencode): add LiteLLM plugin integration #29937 (feat(opencode): add LiteLLM plugin integration #29937): LiteLLM plugin integration, currently open
This also reads /v1/models and enriches models using /model/info. It is directly relevant to your setup, but has had no maintainer review despite being open since May. - feat(opencode): auto-discover models from OpenAI-compatible providers #32731 (feat(opencode): auto-discover models from OpenAI-compatible providers #32731): generic OpenAI-compatible discovery, currently open but conflicting
It includes endpoint filtering, limit parsing, an opt-out, concurrency work, and warning handling. - Feat #6231 - automatic discovery of models from providers #39176 (Feat #6231 - automatic discovery of models from providers #39176): another generic discovery attempt
It was automatically closed by the same old-PR/low-reaction cleanup, without a maintainer review. - feat(provider): add dynamic model discovery for custom providers #42660 (feat(provider): add dynamic model discovery for custom providers #42660): dynamic custom-provider discovery, currently open
It adds UI discovery, background refresh, tests, and SDK support. Review commentary raised startup-delay and server-side request forgery concerns. It is currently marked blocked. - fix(provider): discover models from openai-compatible endpoints #48549 (fix(provider): discover models from openai-compatible endpoints #48549): minimal generic /models implementation, currently open
This is a newer, narrower attempt that avoids much of the previous scope. It still only solves model enumeration, not LiteLLM /model/info enrichment.
There were also several provider-specific implementations. Modal, GitLab, Ollama, and vLLM discovery work has been accepted in various forms, while the generic custom-provider implementation remains unresolved.
There were also several provider-specific implementations. Modal, GitLab, Ollama, and vLLM discovery work has been accepted in various forms, while the generic custom-provider implementation remains unresolved.
I now see #29937 as something to watch as it consumes LiteLLM /model/info. Generic discovery PRs would still leave you needing the remote model metadata.
Feature hasn't been suggested before.
Describe the enhancement you want to request
It has the standard OpenAI discovery endpoint:
{ "data": [ { "id": "claude-fable-5-1", "object": "model", "created": 1677610602, "owned_by": "openai" }, { "id": "deepseek-flash", "object": "model", "created": 1677610602, "owned_by": "openai", "mode": "chat", "max_input_tokens": 1000000, "max_output_tokens": 393216 }, ... ], "object": "list" }And the much more descriptive model info discovery endpoint:
{ "data": [ { "model_name": "claude-fable-5-1", "litellm_params": { "litellm_credential_name": "anthropic", "allow_client_keepalive_override": false, "use_in_pass_through": false, "use_litellm_proxy": false, "use_xai_oauth": false, "merge_reasoning_content_in_choices": false, "model": "anthropic/claude-fable-5-1", "reasoning_effort": "high" }, "model_info": { "id": "a4f4e83c4b403c4592f50403e15a97e90128048bcc1308301b1bb8118cf27906", "db_model": false, "access_via_team_ids": [], "direct_access": true, "key": "claude-fable-5-1", "max_tokens": 128000, "max_input_tokens": 1000000, "max_output_tokens": 128000, "input_cost_per_token": 0.00001, "input_cost_per_token_flex": null, "input_cost_per_token_priority": null, "input_cost_per_token_ultrafast": null, "cache_creation_input_token_cost": 0.0000125, "cache_creation_input_token_cost_above_200k_tokens": null, "cache_creation_input_token_cost_above_272k_tokens": null, "cache_creation_input_token_cost_above_272k_tokens_priority": null, "cache_creation_input_token_cost_above_272k_tokens_flex": null, "cache_creation_input_token_cost_flex": null, "cache_creation_input_token_cost_priority": null, "cache_creation_input_token_cost_ultrafast": null, "cache_read_input_token_cost": 2.5E-7, "prompt_cache_min_tokens": 512, "cache_read_input_token_cost_above_200k_tokens": null, "cache_read_input_token_cost_above_200k_tokens_priority": null, "cache_read_input_token_cost_above_272k_tokens": null, "cache_read_input_token_cost_above_272k_tokens_priority": null, "cache_read_input_token_cost_above_272k_tokens_flex": null, "cache_read_input_token_cost_above_512k_tokens": null, "cache_read_input_token_cost_flex": null, "cache_read_input_token_cost_priority": null, "cache_read_input_token_cost_ultrafast": null, "cache_creation_input_token_cost_above_1hr": 0.00002, "input_cost_per_character": null, "input_cost_per_token_above_128k_tokens": null, "input_cost_per_token_above_200k_tokens": null, "input_cost_per_token_above_200k_tokens_priority": null, "input_cost_per_token_above_272k_tokens": null, "input_cost_per_token_above_272k_tokens_priority": null, "input_cost_per_token_above_272k_tokens_flex": null, "input_cost_per_token_above_512k_tokens": null, "input_cost_per_query": null, "input_cost_per_second": null, "input_cost_per_audio_token": null, "input_cost_per_image_token": null, "input_cost_per_video_token": null, "input_cost_per_image": null, "input_cost_per_audio_per_second": null, "input_cost_per_video_per_second": null, "input_cost_per_token_batches": null, "output_cost_per_token_batches": null, "output_cost_per_token": 0.00005, "output_cost_per_token_flex": null, "output_cost_per_token_priority": null, "output_cost_per_token_ultrafast": null, "regional_processing_uplift_multiplier_eu": null, "regional_processing_uplift_multiplier_us": null, "regional_endpoint_uplift_multiplier": null, "output_cost_per_audio_token": null, "output_cost_per_character": null, "output_cost_per_reasoning_token": null, "output_cost_per_reasoning_token_flex": null, "output_cost_per_reasoning_token_priority": null, "output_cost_per_token_above_128k_tokens": null, "output_cost_per_character_above_128k_tokens": null, "output_cost_per_token_above_200k_tokens": null, "output_cost_per_token_above_200k_tokens_priority": null, "output_cost_per_token_above_272k_tokens": null, "output_cost_per_token_above_272k_tokens_priority": null, "output_cost_per_token_above_272k_tokens_flex": null, "output_cost_per_token_above_512k_tokens": null, "output_cost_per_second": null, "output_cost_per_second_1080p": null, "output_cost_per_video_per_second": null, "output_cost_per_image": null, "output_cost_per_image_token": null, "output_cost_per_video_token": null, "output_vector_size": null, "citation_cost_per_token": null, "tiered_pricing": null, "litellm_provider": "anthropic", "mode": "chat", "supports_system_messages": null, "supports_response_schema": true, "supports_vision": true, "supports_function_calling": true, "supports_tool_choice": true, "supports_assistant_prefill": false, "supports_prompt_caching": true, "supports_prompt_cache_breakpoint": null, "supports_audio_input": null, "supports_audio_output": null, "supports_pdf_input": true, "supports_embedding_image_input": null, "supports_native_streaming": null, "supports_native_structured_output": true, "supports_web_search": null, "supports_url_context": null, "supports_reasoning": true, "supports_adaptive_thinking": true, "thinking_always_on": true, "supports_tool_search": null, "supports_mid_conversation_system": true, "supports_none_reasoning_effort": null, "supports_minimal_reasoning_effort": null, "supports_low_reasoning_effort": null, "supports_xhigh_reasoning_effort": true, "supports_max_reasoning_effort": true, "bedrock_output_config_effort_ceiling": null, "bedrock_converse_supports_strict_tools": null, "supports_computer_use": true, "search_context_cost_per_query": { "search_context_size_high": 0.01, "search_context_size_low": 0.01, "search_context_size_medium": 0.01 }, "web_search_billing_unit": null, "tpm": null, "rpm": null, "ocr_cost_per_page": null, "ocr_cost_per_credit": null, "annotation_cost_per_page": null, "provider_specific_entry": { "us": 1.1 }, "uses_embed_content": null, "supports_image_size": null, "supported_openai_params": [ "stream", "stop", "temperature", "top_p", "max_tokens", "max_completion_tokens", "tools", "tool_choice", "extra_headers", "parallel_tool_calls", "response_format", "user", "web_search_options", "speed", "context_management", "cache_control", "thinking", "reasoning_effort" ] } }, { "model_name": "deepseek-flash", "litellm_params": { "litellm_credential_name": "deepseek", "allow_client_keepalive_override": false, "use_in_pass_through": false, "use_litellm_proxy": false, "use_xai_oauth": false, "merge_reasoning_content_in_choices": false, "model": "deepseek/deepseek-v4-flash-vision-exp", "reasoning_effort": "high" }, "model_info": { "id": "780e0333cf29e85230de2724a95d2613ebb25617b44adaeddeeebe5a64ac35d2", "db_model": false, "access_via_team_ids": [], "direct_access": true, "key": "deepseek/deepseek-v4-flash-vision-exp", "max_tokens": 393216, "max_input_tokens": 1000000, "max_output_tokens": 393216, "input_cost_per_token": 4.4E-7, "input_cost_per_token_flex": null, "input_cost_per_token_priority": null, "input_cost_per_token_ultrafast": null, "cache_creation_input_token_cost": 0.0, "cache_creation_input_token_cost_above_200k_tokens": null, "cache_creation_input_token_cost_above_272k_tokens": null, "cache_creation_input_token_cost_above_272k_tokens_priority": null, "cache_creation_input_token_cost_above_272k_tokens_flex": null, "cache_creation_input_token_cost_flex": null, "cache_creation_input_token_cost_priority": null, "cache_creation_input_token_cost_ultrafast": null, "cache_read_input_token_cost": 1.4E-8, "prompt_cache_min_tokens": null, "cache_read_input_token_cost_above_200k_tokens": null, "cache_read_input_token_cost_above_200k_tokens_priority": null, "cache_read_input_token_cost_above_272k_tokens": null, "cache_read_input_token_cost_above_272k_tokens_priority": null, "cache_read_input_token_cost_above_272k_tokens_flex": null, "cache_read_input_token_cost_above_512k_tokens": null, "cache_read_input_token_cost_flex": null, "cache_read_input_token_cost_priority": null, "cache_read_input_token_cost_ultrafast": null, "cache_creation_input_token_cost_above_1hr": null, "input_cost_per_character": null, "input_cost_per_token_above_128k_tokens": null, "input_cost_per_token_above_200k_tokens": null, "input_cost_per_token_above_200k_tokens_priority": null, "input_cost_per_token_above_272k_tokens": null, "input_cost_per_token_above_272k_tokens_priority": null, "input_cost_per_token_above_272k_tokens_flex": null, "input_cost_per_token_above_512k_tokens": null, "input_cost_per_query": null, "input_cost_per_second": null, "input_cost_per_audio_token": null, "input_cost_per_image_token": null, "input_cost_per_video_token": null, "input_cost_per_image": null, "input_cost_per_audio_per_second": null, "input_cost_per_video_per_second": null, "input_cost_per_token_batches": null, "output_cost_per_token_batches": null, "output_cost_per_token": 0.00000132, "output_cost_per_token_flex": null, "output_cost_per_token_priority": null, "output_cost_per_token_ultrafast": null, "regional_processing_uplift_multiplier_eu": null, "regional_processing_uplift_multiplier_us": null, "regional_endpoint_uplift_multiplier": null, "output_cost_per_audio_token": null, "output_cost_per_character": null, "output_cost_per_reasoning_token": null, "output_cost_per_reasoning_token_flex": null, "output_cost_per_reasoning_token_priority": null, "output_cost_per_token_above_128k_tokens": null, "output_cost_per_character_above_128k_tokens": null, "output_cost_per_token_above_200k_tokens": null, "output_cost_per_token_above_200k_tokens_priority": null, "output_cost_per_token_above_272k_tokens": null, "output_cost_per_token_above_272k_tokens_priority": null, "output_cost_per_token_above_272k_tokens_flex": null, "output_cost_per_token_above_512k_tokens": null, "output_cost_per_second": null, "output_cost_per_second_1080p": null, "output_cost_per_video_per_second": null, "output_cost_per_image": null, "output_cost_per_image_token": null, "output_cost_per_video_token": null, "output_vector_size": null, "citation_cost_per_token": null, "tiered_pricing": null, "litellm_provider": "deepseek", "mode": "chat", "supports_system_messages": true, "supports_response_schema": true, "supports_vision": true, "supports_function_calling": true, "supports_tool_choice": true, "supports_assistant_prefill": true, "supports_prompt_caching": true, "supports_prompt_cache_breakpoint": null, "supports_audio_input": null, "supports_audio_output": null, "supports_pdf_input": null, "supports_embedding_image_input": null, "supports_native_streaming": true, "supports_native_structured_output": null, "supports_web_search": null, "supports_url_context": null, "supports_reasoning": true, "supports_adaptive_thinking": null, "thinking_always_on": null, "supports_tool_search": null, "supports_mid_conversation_system": null, "supports_none_reasoning_effort": null, "supports_minimal_reasoning_effort": null, "supports_low_reasoning_effort": null, "supports_xhigh_reasoning_effort": null, "supports_max_reasoning_effort": null, "bedrock_output_config_effort_ceiling": null, "bedrock_converse_supports_strict_tools": null, "supports_computer_use": null, "search_context_cost_per_query": null, "web_search_billing_unit": null, "tpm": null, "rpm": null, "ocr_cost_per_page": null, "ocr_cost_per_credit": null, "annotation_cost_per_page": null, "provider_specific_entry": null, "uses_embed_content": null, "supports_image_size": null, "supported_openai_params": [ "frequency_penalty", "logit_bias", "logprobs", "top_logprobs", "max_tokens", "max_completion_tokens", "modalities", "prediction", "n", "presence_penalty", "seed", "stop", "stream", "stream_options", "temperature", "top_p", "tools", "tool_choice", "function_call", "functions", "max_retries", "extra_headers", "parallel_tool_calls", "audio", "web_search_options", "service_tier", "safety_identifier", "prompt_cache_key", "prompt_cache_retention", "store", "response_format", "thinking", "reasoning_effort" ] } }, ... ] }