AI Routerby Codrihub Tech

Coming soon — still in development

AI Routerby Codrihub Tech

Your own OpenAI-compatible server, inside the VS Code Chat view.

Adds OpenAI-compatible servers (9Router, vLLM, Ollama, LM Studio, llama.cpp and others) as language model providers in the VS Code Chat view.

Not released yet — install links will appear here when it ships.

VS Code extension MIT licensed Build 1.13.2 in development
VS Code with the 9R CT provider manager open in a light theme VS Code with the 9R CT provider manager open in a dark theme, listing three providers and the Features switches

What it does

Connect VS Code’s Chat view to your own server.

Point the Chat view at any server that speaks the OpenAI API — 9Router, vLLM, Ollama, LM Studio, llama.cpp, LocalAI, LiteLLM or anything else — and pick its models right in the model picker.

Your infrastructureInference stays on servers you control.
No per-token feeThe extension itself charges nothing per token.
No premium quotaChat through your own models without using Copilot premium quota.

Self-hosted models are not always as well-behaved as a hosted API. AI Router smooths the rough edges:

  • Malformed tool calls repairedTool calls that come back as broken JSON — truncated arguments, missing required fields — are fixed before they reach the chat.
  • Reasoning goes to the thinking UI<think> blocks from reasoning models are routed into the Chat view’s thinking area instead of being printed as regular text.
  • Real context limits learnedContext-length errors are parsed to learn the model’s actual limit, then the request is retried within it.
  • Stricter when tools leak as textA model that writes tool names as plain text gets a lower temperature and stricter formatting.

Supported servers

Works with OpenAI-compatible servers.

If it answers the OpenAI API, it can be a provider. Add as many as you like and order them by priority.

9RouterDefault address http://localhost:20128
vLLMNo key needed; enable auto tool choice for tool calls
OllamaNo key needed; Modelfile temperature is respected
LM StudioOpenAI-compatible local server
llama.cppNo key needed
LocalAIOpenAI-compatible API
LiteLLMOpenAI-compatible API
Anything OpenAI-compatibleSpeaks /v1/models and /v1/chat/completions

Enter the bare domain; AI Router appends /v1, /v1/models and /v1/chat/completions itself.

Key features

Everything managed from one side bar view.

The 9R CT view brings providers, feature switches and models together, next to Chat.

Provider manager

Add, edit, test, enable or disable and reorder servers from the 9R CT view in the secondary side bar.

  • API keys live in VS Code secret storage, never in settings
  • Disabled providers stay editable and testable

Plain on/off features

Tool calling, image input, parallel tool calls, inline completion, auto retry on empty responses and auto fallback — each a single switch.

Model control

List a provider’s models, rename them for display, mark which accept tools or images, and pin the ones you use often.

  • Pinned models lead the Chat model picker
  • Stale pins are shown as “Not available”

Default & backup models

Give each provider a default model and up to seven backups, as an ordered list. The default also leads the picker.

Auto fallback (opt-in)

When a request fails in a way another server could resolve, it is retried on your other enabled providers, in list order.

  • Reacts to timeouts, network errors, 401/402/403/404/408/429 and 5xx
  • Failed providers cool down for 60 s by default

Inline completion

Optional ghost-text suggestions from your server, with their own model, token, debounce and timeout settings.

Private by default

Prompts and file contents go only to the server you configure. Verbose request logging is off unless you turn it on.

Theme-aware UI

A soft dark palette tuned to stay at or above WCAG AA, readable light themes, untouched high-contrast themes, and reduced-motion support.

Screenshots

See it inside VS Code.

How it works

Four steps from install to chat.

  1. Open the 9R CT view

    Install the extension and open the 9R CT view. It lives in the secondary side bar, next to Chat.

  2. Add your server

    Press Add and enter the server’s domain only, for example http://localhost:20128. No /v1 — the extension appends it. Add an API key only if the server needs one.

  3. Test the connection

    Press Test. The extension reads /v1/models and tells you exactly why if something is wrong.

  4. Pick a model and chat

    In the Chat view’s model picker, choose a model under the extension’s entry. Requests go to /v1/chat/completions on your server.

Settings & commands

Sensible defaults, tunable when you need it.

Feature switches live in the side bar. The settings below cover defaults, limits and advanced per-model tuning.

Settings (prefix 9router-codrihub-tech.)
SettingDefaultWhat it does
serverUrlhttp://localhost:20128Used only while no provider is configured in the sidebar.
requestTimeout60000Milliseconds before a request is abandoned.
defaultMaxTokens262144Assumed context window when the server reports none.
defaultMaxOutputTokens4096Assumed max output tokens when the server reports none.
agentTemperature0Temperature for requests that include tools.
modelContextWindows{}Per-model context window overrides; * matches a family.
extraModelOptions{}Extra parameters merged into every request, e.g. top_k or seed.
perModelOptions{}Per-model request parameters; a trailing * matches a family.
autoRetryMaxAttempts2Retries for an empty response; 0 disables it.
fallbackCooldownSeconds60How long a failed provider waits before rejoining fallback.
verboseLoggingfalseFull request bodies in the output log. Leave off unless diagnosing.
inlineCompletion*see editorModel, max tokens, debounce, timeout and prefix/suffix size.
  • Command PaletteCategory “9Router Codrihub Tech”
  • Manage Providers
  • Configure Server
  • Configure Features
  • Test Server Connection
  • Refresh Models
  • Edit Custom Headers
  • Show Output Log

API keys and custom HTTP headers are kept in VS Code’s secret storage, not in settings.

Coming soon — still in development

Get AI Router

AI Router is still being polished and is not available to install yet. Every install channel below will open once it is released.