Repository navigation
[FEATURE]: Add LiteLLM as a provider #48938
Copy link
Copy link
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Same as #22212 but opening a new issue as requested by GitHub Actions bot.
Users who run LiteLLM as a proxy for 100+ LLM providers can't point opencode at it. They have to configure each provider individually even when LiteLLM already provides a unified OpenAI-compatible endpoint.
It has the standard OpenAI discovery endpoint:
/v1/models
{
"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:
/model/info
{
"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"
]
}
},
...
]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Sep 14, 2026
This issue might be a duplicate of existing issues. Please check:
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.
el-AI-wei commentedon Sep 14, 2026
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
“Merging into a separate branch that I'll play with for a bit and see if tweaks are needed”
Why It Stalled
The fundamental issue was that /v1/models discovery solves only part of the problem.
The standard response usually provides:
That does not provide the information OpenCode relies on for:
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:
There Were Follow-Ups
Notable examples:
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.
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.
It includes endpoint filtering, limit parsing, an opt-out, concurrency work, and warning handling.
It was automatically closed by the same old-PR/low-reaction cleanup, without a maintainer review.
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.
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.
neriousy commentedon Oct 21, 2026
Thanks, and thanks @el-AI-wei for the detailed history. A few pieces here:
/connectbelongs in models.dev; there's an open PR for it (feat: add LiteLLM provider models.dev#9404)./model/infois a good fit for a plugin: the V2 plugin API lets a plugin load a provider's model list at runtime and publish it (https://opencode.ai/v2/docs/build/plugins#providers), the same way the built-in Ollama, LM Studio and vLLM discovery works.We're not planning to build LiteLLM-specific discovery into core, so closing as not planned. If the plugin API is missing something needed to build it, please open an issue for the missing piece.