Skip to content

lqdflying/OAIProxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

284 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OAIProxy Logo

OAIProxy

A self-maintained VS Code extension to use OpenAI/Ollama/Anthropic/Gemini API providers in GitHub Copilot Chat, with presets for Kimi, DeepSeek, and MiniMax ๐Ÿ”ฅ

English | ็ฎ€ไฝ“ไธญๆ–‡

License

Features

  • Multi-API support: OpenAI/Ollama/Anthropic/Gemini APIs, with OpenAI-compatible presets for Kimi, DeepSeek, MiniMax, ModelScope, SiliconFlow, and more
  • Vision models: Full support for image understanding capabilities
  • Vision Bridge: Use images in chat with text-only models โ€” OAIProxy automatically describes images via a configured vision model with LRU caching
  • Think tag support: Seamless display of model thinking/reasoning blocks across all providers (OpenAI, Ollama, Gemini, Anthropic)
  • Thinking Effort control: VS Code's built-in per-model Thinking Effort dropdown in the model picker โ€” customize reasoning effort on the fly
  • Advanced configuration: Flexible chat request options with thinking/reasoning control
  • Multi-provider management: Configure models from multiple providers simultaneously with automatic API key management
  • Multi-config per model: Define different settings for the same model (e.g., GLM-4.6 with/without thinking)
  • Visual configuration UI: Intuitive interface for managing providers and models
  • Auto-retry: Handles API errors (429, 500, 502, 503, 504) with exponential backoff
  • Request cancellation: Stop in-progress chat requests instantly โ€” cancellation is wired to HTTP AbortController across all API modes
  • Token usage: Real-time token counting and provider API key management from status bar
  • Git integration: Generate commit messages directly from source control with OpenAI/OpenAI Responses/Ollama/Anthropic models
  • Import/export: Easily share and backup configurations
  • Tools optimization: Optimize agent read_file tool handling for supported streamed tool calls, avoiding small chunks for large files.
  • Structured logging: File-based request/debug logs with rotation, configurable levels (off/debug/info/warn/error)

Requirements

  • VS Code 1.120.0 or higher.
  • OpenAI-compatible provider API key.

Quick Start

  1. Install the OAIProxy VSIX package (lqdflying.oaiproxy).
  2. Open VS Code Settings and configure oaicopilot.baseUrl and oaicopilot.models.
  3. Open GitHub Copilot Chat interface.
  4. Click the model picker and select "Manage Models...".
  5. Choose "OAIProxy" provider.
  6. Enter your API key โ€” it will be saved locally.
  7. Select the models you want to add to the model picker.

Compatibility note: OAIProxy keeps the existing oaicopilot.* settings keys, so your JSON model configuration stays valid. Because the extension ID changed to lqdflying.oaiproxy, VS Code may require entering API keys once under the new extension.

Settings Example

"oaicopilot.baseUrl": "https://api-inference.modelscope.cn/v1",
"oaicopilot.models": [
    {
        "id": "Qwen/Qwen3-Coder-480B-A35B-Instruct",
        "owned_by": "modelscope",
        "context_length": 256000,
        "max_tokens": 8192
    }
]

Configuration UI

The extension provides a visual configuration interface for managing providers, models, and API keys without editing JSON files manually. Open via the Command Palette (OAIProxy: Open Configuration UI) or click the OAIProxy status bar item.

The Provider Management form includes presets for Kimi, DeepSeek, and MiniMax. Selecting a preset fills the provider ID, base URL, and openai API mode; you still choose the model ID from the provider's current documentation or model list.

โ†’ Full Configuration Guide

Multi-API Mode

Supports five API protocols: openai (Chat Completions), openai-responses (Responses), ollama, anthropic, and gemini. Specify per-model via the apiMode parameter.

Kimi, DeepSeek, and MiniMax use the existing openai mode because their hosted APIs are OpenAI-compatible.

โ†’ Full Multi-API Guide

Vision Bridge

Use images with text-only models. OAIProxy automatically describes images via a configured vision-capable model before forwarding as text, with LRU caching (50 entries, ~500KB).

โ†’ Vision Bridge Guide

Multi-Provider Guide

Configure models from multiple providers simultaneously. Use owned_by to group models by provider, with automatic per-provider API key management stored as oaicopilot.apiKey.<provider>.

โ†’ Multi-Provider Guide

Multi-config for the same model

Define multiple configurations for the same model ID via configId (e.g., glm-4.6::thinking and glm-4.6::no-thinking), each with independent settings.

โ†’ Multi-config Guide

Thinking Effort Control

VS Code 1.120+ exposes a per-model Thinking Effort dropdown in the model picker. Enable it with supports_reasoning_effort: true. DeepSeek models default to high/max.

โ†’ Thinking Effort Guide

Custom Headers

Specify custom HTTP headers per model provider (API versioning, additional auth, debugging tokens). Merged with default headers on each request.

โ†’ Custom Headers Guide

Custom Request Body Parameters

Use the extra field to inject arbitrary JSON parameters into the API request body for all API modes. Override standard parameters or add provider-specific features.

โ†’ Custom Request Body Guide

Model Parameters

Full reference of all 30+ configurable model parameters (id, owned_by, temperature, reasoning_effort, vision, toolCalling, apiMode, etc.).

โ†’ Model Parameters Reference

Logging

OAIProxy always writes extension lifecycle events (install, update, activate) to the VS Code Output panel. Open Output: Show Output and select OAIProxy.

For request/debug logs, add this to VS Code User Settings JSON:

"oaicopilot.logLevel": "debug"

Valid values are off, debug, info, warn, and error. File logs are written to ~/.copilot/oaiproxy/logs/ with daily rotation (logs older than 7 days are automatically cleaned up). Sensitive header values (Authorization, x-api-key, x-goog-api-key) are automatically redacted from log output.

Thanks to

Thanks to all the people who contribute.

Support & License

About

A VSCode extension to use Openai/Ollama/Anthropic/Gemini API Providers in GitHub Copilot Chat

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors