O2ter AI
A VS Code extension that provides an AI chat panel backed by any OpenAI-compatible API. Configure one or more Model Profiles (endpoint, model, API key, visual input flag, context window size, system prompt) and switch between them inside the chat panel.
Features
- Multi-Profile Support: Configure multiple AI model profiles and switch between them seamlessly
- OpenAI-Compatible: Works with any OpenAI-compatible API endpoint (OpenAI, local LLMs, etc.)
- Visual Input: Attach images to messages for models that support multimodal input
- Inline Completions: AI-powered ghost text completions as you type
- Conversation History: Persist and manage multiple conversations
- Agent Tools: Built-in tools for filesystem operations, terminal commands, diagnostics, web fetching, workspace info, and more
- Automatic Summarization: Context window management with automatic conversation summarization
- Custom System Prompts: Per-profile system prompts for tailored behavior
Requirements
- VS Code 1.120.0 or higher
- Access to an OpenAI-compatible API endpoint
Getting Started
Open VS Code settings and add a profile under o2ter-ai.profiles:
{
"o2ter-ai.profiles": [
{
"id": "local-docker",
"name": "Local Docker AI",
"endpoint": "http://localhost:12434/engines/v1",
"model": "ai/gemma4",
"apiType": "openai",
"visualInput": true
}
]
}
API keys are stored securely in the system keychain.
2. Open the Chat Panel
- Click the O2ter AI icon in the Activity Bar, or
- Run the command palette command: O2ter AI: Open AI Chat
3. Start Chatting
Select a model profile from the dropdown and start asking questions. The AI can:
- Answer questions about your code
- Read and write files in your workspace
- Run terminal commands (with permission)
- Fetch web pages
- Search symbols and get workspace info
Model Profile Details
A Model Profile defines the connection settings and behavior constraints for a specific AI model. Key fields include:
id / name: Unique identifier and display name for the profile.
endpoint: The base URL for the OpenAI-compatible API endpoint.
model: The specific model identifier to use (e.g., gpt-4, ai/gemma4).
apiType: Fixed as 'openai' for compatibility layer.
apiKey: The secret key required for authentication.
reasoningKey?: Defines the key used in the API response to identify model reasoning content.
reasoningInjection?: If true, forces injection of the reasoning content into the message body to ensure persistence across turns.
visualInput?: A boolean flag to enable image attachment support in the chat UI.
systemPrompt?: A custom prompt that sets the AI's persona and instructions for all conversations using this profile.
maxMessages?: Limits the total number of messages before automatic context summarization kicks in (default: 100).
maxTokens?: An optional token threshold from the last response that triggers summarization, allowing for token-budget-aware context management.
contextWindowRatio?: Determines what percentage of the conversation history to retain after summarization (default: 50).
Usage & Context Configuration
For local deployments, you may need to configure the model's context size externally; for instance, a docker using llama.cpp may impose a fixed size limitation.
Context Size Configuration:
For models like Gemma4 running via a Docker-compatible engine, you can configure the context size before starting the chat session using a command such as:
docker model configure --context-size 100000 ai/gemma4
Note that some engines, such as those using llama.cpp, may have a fixed context size (e.g., 4096).
Reasoning Content Persistence:
The reasoningInjection flag is specifically helpful for models, such as Gemma4, that might otherwise strip out internal reasoning content from the message history. Setting this flag forces the injection of reasoning content into the message body, ensuring it persists across conversation turns.
Repository
https://github.com/o2ter/vscode-ai.git