GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Add LiteLLM as a provider · Issue #48938 · anomalyco/opencode

[FEATURE]: Add LiteLLM as a provider #48938

New issue
Copy link
New issue
Copy link
Closed as not planned
#57161
Closed as not planned
[FEATURE]: Add LiteLLM as a provider#48938
#57161
Copy link
Assignees
neriousy

Description

@jsilvermist
jsilvermist
opened on Sep 14, 2026
Issue body actions

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"
        ]
      }
    },
    ...
  ]
}
Reacted by El AI, Gilian Rehm, Ivan Barsukov, Karim Heraud and Eskild Diderichsen

Activity

  1. github-actions
    assigned
    neriousy
    on Sep 14, 2026
  2. github-actions commented on Sep 14, 2026

    @github-actions
    github-actionsBot
    on Sep 14, 2026 – with GitHub Actions
    Contributor
    More actions

    This 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.

  3. el-AI-wei commented on Sep 14, 2026

    @el-AI-wei
    el-AI-wei
    on Sep 14, 2026
    More actions

    Seem like a no-brainer to have a provider which can consume LiteLLM’s /model/info metadata to get limits, costs, modalities, and capabilities. It seemed like PR 8359 addresses this and got stalled so I investigated:

    What Happened

    1. 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.
    2. 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?
    1. 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.
    2. 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”
    3. That branch then received two commits named wip. One changed discovery toward filtering known models and left adding unknown endpoint models unfinished.
    4. 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.
    5. 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.

  4. neriousy commented on Oct 21, 2026

    @neriousy
    neriousy
    on Oct 21, 2026
    Member
    More actions

    Thanks, and thanks @el-AI-wei for the detailed history. A few pieces here:

    • You can point opencode at a LiteLLM proxy today as a custom OpenAI-compatible provider: https://opencode.ai/v2/docs/providers#custom (the Models docs even use LiteLLM as an example: https://opencode.ai/v2/docs/models#prompt-caching).
    • A LiteLLM entry for /connect belongs in models.dev; there's an open PR for it (feat: add LiteLLM provider models.dev#9404).
    • Discovering models, limits and costs from /model/info is 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.

  5. neriousy
    closed this as not plannedon Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @neriousy
    neriousy

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.