Skip to content

FEATURE: BYOM provider registration for generic local inference endpoints (non-Anthropic) #3624

Closed

Description

@ian-morgan99

Problem Statement

Copilot CLI supports BYOM providers since v1.0.32+, but the supported providers are limited to Anthropic-specific configurations. There is no configuration path for generic local inference endpoints (e.g., LM Studio, Ollama, llama.cpp) that serve OpenAI-compatible APIs.

This means:

  • Local models cannot be registered as BYOM providers for main session tool calls
  • Subagent tasks dispatched via runSubagent have no local routing path
  • Extensions like VSCode-LMStudio-Bridge cannot expose local models to the Copilot ecosystem

How Other Agents Handle This

Opencode (anomalyco/opencode)

  • Provider config system with explicit provider registration
  • Supports llama.cpp, Ollama, and generic OpenAI-compatible endpoints
  • Subagents inherit session model; provider configuration flows through all dispatch paths

Claude Code (anthropics/claude-code)

  • Defaults to cloud but overridable via SG_AGENTIC_MODEL env var
  • Model selection is per-request, not session-bound
  • Allows explicit model override for subagent tasks

Codex (openai/codex)

  • ModelProvider abstraction with routing layer (models_endpoint.rs)
  • Supports multiple providers including Amazon Bedrock and local endpoints
  • Clean separation between tool execution and model inference

What We Need

  1. Generic BYOM provider registration: Allow configuration of arbitrary OpenAI-compatible endpoints as BYOM providers
  2. Subagent model inheritance: Ensure subagent tasks respect the session model when it is a local endpoint
  3. Provider priority/fallback: Support tiered routing (local first, cloud fallback with warning)

Security Implications

  • Data leakage: Workspace context transmitted to cloud without user consent when local models are available
  • Cost opacity: Untracked cloud API usage from subagent tasks
  • Trust erosion: Silent cloud routing violates local-only expectations
  • Compliance risk: Sensitive code may be processed by third-party inference services

Related Issues

Acceptance Criteria

  1. Generic OpenAI-compatible endpoints can be registered as BYOM providers
  2. Subagent tasks respect session model when it is a local endpoint
  3. Provider priority/fallback configuration is supported
  4. Cost/privacy warnings display when cloud fallback triggers
  5. Documentation updated with routing behavior and configuration options

Activity

  1. added
    area:models
    area:configuration
    on Jun 1, 2026
  2. added theissue type on Jun 1, 2026
  3. stephentoub commented on Jun 2, 2026

    @stephentoub

    As noted in your duplicate issue at microsoft/copilot-sdk#1545, endpoints compatible with both OpenAI chat completions API and responses API are supported.

    https://github.com/github/copilot-sdk/blob/main/docs/auth/byok.md

  4. ian-morgan99 commented on Jun 3, 2026

    @ian-morgan99
    Author

    Apologies if I'm misunderstanding — I think my point may not have come across clearly in the original issue, so let me try to restate it more precisely.

    The response was: "endpoints compatible with both OpenAI chat completions API and responses API are supported."

    I believe that's true at the SDK level. What I wasn't clear about is that the ask isn't about endpoint compatibility — it's about the configuration surface to wire a local endpoint into the CLI session.

    Here's what I'm observing:

    1. The BYOK docs list Ollama and Foundry Local as supported providers with type "openai"
    2. However, there's no documented config path in ~/.github/copilot-cli.json (or via CLI flags) to register a local endpoint as a BYOM provider for main session tool calls
    3. When selecting "Copilot CLI" in VS Code, local models don't appear in the model picker

    So the gap isn't that the SDK can't handle OpenAI-compatible endpoints. It's that there's no user-facing surface to tell the CLI "use this endpoint for my session."

    To be concrete: if I run LM Studio on localhost:1234, what config do I add to make it visible as a BYOM provider in the CLI? If there's a documented path I've missed, I'd be very grateful for a pointer.

    If no such surface exists yet, I think the original issue is still valid — not as an endpoint compatibility question, but as a missing registration surface for local inference endpoints.

    Thanks for the response, and sorry for the confusion in the original framing. Happy to provide more detail if it helps clarify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationarea:models

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions