switchAILocal

module
v0.5.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: Apache-2.0

README

switchAILocal Logo

switchAILocal

One local endpoint. All your AI providers.

Official DocumentationQuick StartInstallationSetup ProvidersAPI Reference


What is switchAILocal?

switchAILocal is a unified API gateway that lets you use all your AI providers through a single OpenAI-compatible endpoint running on your machine.

Key Benefits

Feature Description
🎨 Modern Web UI Single-file React dashboard to configure providers, manage model routing, and adjust settings (226 KB, zero dependencies)
🔑 Use Your Subscriptions Connect Gemini CLI, Claude Code, Codex, Ollama, and more—no API keys needed
🎯 Single Endpoint Any OpenAI-compatible tool works with http://localhost:18080
📎 CLI Attachments Pass files and folders directly to CLI providers via extra_body.cli
🧠 Superbrain Intelligence Autonomous self-healing: monitors executions, diagnoses failures with AI, auto-responds to prompts, restarts with corrective flags, and routes to fallback providers
⚖️ Load Balancing Round-robin across multiple accounts per provider
🔄 Intelligent Failover Smart routing to alternatives based on capabilities and success rates
📊 Observability Ready Enterprise-grade JSON structured logging, raw NDJSON event streams, and a native /metrics endpoint for Prometheus & Grafana integration
🔒 Local-First Everything runs on your machine, your data never leaves

Supported Providers

CLI Tools (Use Your Paid Subscriptions)

Provider CLI Tool Prefix Status
Google Gemini gemini geminicli: ✅ Ready
Anthropic Claude claude claudecli: ✅ Ready
OpenAI Codex codex codex: ✅ Ready
Mistral Vibe vibe vibe: ✅ Ready
OpenCode opencode opencode: ✅ Ready

Local Models

Provider Prefix Status
Ollama ollama: ✅ Ready
LM Studio lmstudio: ✅ Ready

Cloud APIs

Provider Prefix Status
Traylinx switchAI switchai: ✅ Ready
Google AI Studio gemini: ✅ Ready
Anthropic API claude: ✅ Ready
OpenAI API openai: ✅ Ready
OpenRouter openai-compat: ✅ Ready

Prerequisites

Requirement Minimum Notes
Node.js 18+ For npx install (recommended)
Go 1.25+ Only needed for building from source
Docker Optional Only needed for ail start --docker
macOS Ventura+ Linux support is experimental

Quick Start

npx @traylinx/switchailocal

That's it. Downloads the right binary for your platform, caches it, and runs.

Option 2: Docker

docker run -p 18080:18080 ghcr.io/traylinx/switchailocal:latest

Option 3: Build from Source

git clone https://github.com/traylinx/switchAILocal.git
cd switchAILocal

# First-time setup (builds binaries, installs bridge service, registers CLI)
./ail.sh setup

# Then start the server (from anywhere, after setup)
ail start

# OR start with Docker (add --build to force rebuild)
ail start --docker --build

2. Connect Your Providers

Choose the authentication method that works best for you:

If you already have gemini, claude, or vibe CLI tools installed and authenticated, switchAILocal uses them automatically. No additional login required!

# Just use the CLI prefix - it works immediately
curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{"model": "geminicli:gemini-2.5-pro", "messages": [...]}'
  • Zero configuration - Uses your existing CLI authentication
  • Works immediately - No --login needed
  • Supports: geminicli:, claudecli:, codex:, vibe:, opencode:
Option B: API Keys (Standard)

Add your AI Studio or Anthropic API keys to config.yaml:

gemini:
  api-key: "your-gemini-api-key"
claude:
  api-key: "your-claude-api-key"

Then use without the cli suffix: gemini:, claude:

Option C: OAuth Cloud Proxy (Advanced - Alternative to CLI)

Only needed if:

  • ❌ You don't have the CLI tools installed
  • ❌ You don't have API keys
  • ✅ You want switchAILocal to manage OAuth tokens directly
# Optional OAuth login (alternative to CLI wrappers)
./switchAILocal --login        # Google Gemini OAuth
./switchAILocal --claude-login # Anthropic Claude OAuth

⚠️ Note: This requires GEMINI_CLIENT_ID and GEMINI_CLIENT_SECRET environment variables. Most users should use Option A (CLI wrappers) instead.

📖 See the Provider Guide for detailed setup instructions.

3. Check Status

./ail.sh status

The server runs on http://localhost:18080.


Usage Examples

Basic Request (Auto-Routing)

When you omit the provider prefix, switchAILocal automatically routes to an available provider:

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "gemini-2.5-pro",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Explicit Provider Selection

Use the provider:model format to route to a specific provider:

# Force Gemini CLI
curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "geminicli:gemini-2.5-pro",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

# Force Ollama
curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "ollama:llama3.2",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

# Force Claude CLI
curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "claudecli:claude-sonnet-4",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

# Force LM Studio
curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "lmstudio:mistral-7b",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Custom Providers & Legacy Client Support

If you use external generic APIs (e.g., DashScope, Groq) via openai-compatibility but your HTTP client strictly hardcodes a legacy model string (e.g., "model": "alibaba:qwen-plus" with a colon), you can seamlessly intercept this payload by assigning an explicit alias:

# config.yaml
openai-compatibility:
  - name: "alibaba"
    prefix: "alibaba"
    base-url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
    models-url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/models"
    api-key-entries:
      - api-key: "sk-your-key-here"
    models:
      - name: "qwen-plus"                # Actual DashScope upstream model
        alias: "alibaba:qwen-plus"       # Captures legacy strictly formatted client requests

Now, your locked-in client can directly query switchAILocal without code changes:

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-key" \
  -d '{
    "model": "alibaba:qwen-plus",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

List Available Models

curl http://localhost:18080/v1/models \
  -H "Authorization: Bearer sk-test-123"

# Filter by modality (text, image, audio, embedding, vision)
curl http://localhost:18080/v1/models?modality=image \
  -H "Authorization: Bearer sk-test-123"

Multimodal API

switchAILocal supports the full OpenAI multimodal API surface:

Embeddings
curl http://localhost:18080/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{"model": "switchai-embed", "input": "Hello world"}'
Image Generation
curl http://localhost:18080/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{"model": "dall-e-3", "prompt": "A sunset over mountains", "size": "1024x1024"}'
Image Editing
curl http://localhost:18080/v1/images/edits \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{"model": "dall-e-3", "prompt": "Add a rainbow", "images": [{"image_url": "https://example.com/photo.png"}]}'
Text-to-Speech

Works natively via the MiniMax T2A adapter — gateway translates OpenAI shape or MiniMax-native shape to MiniMax /v1/t2a_v2 behind the scenes. Use MiniMax voice IDs (not OpenAI voice names):

curl http://localhost:18080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "ail-speech",
    "input": "Hello from switchAILocal",
    "voice": "English_expressive_narrator",
    "response_format": "mp3"
  }' --output speech.mp3

MiniMax-native T2A controls are also accepted through the same endpoint:

curl http://localhost:18080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "ail-speech",
    "text": "Omg(sighs), hello from switchAILocal",
    "stream": false,
    "voice_setting": {"voice_id": "English_expressive_narrator", "speed": 1, "vol": 1, "pitch": 0},
    "audio_setting": {"sample_rate": 32000, "bitrate": 128000, "format": "mp3", "channel": 1},
    "language_boost": "auto",
    "output_format": "hex"
  }' --output speech.mp3

Common voice IDs: English_expressive_narrator, male-qn-qingse, female-shaonv, audiobook_male_2, presenter_male, clever_boy. Formats: mp3, flac, wav.

Audio Transcription
curl http://localhost:18080/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-test-123" \
  -F file="@audio.mp3" \
  -F model="whisper-large-v3"
Music Generation

Generate songs (text-to-music) or covers via MiniMax. 30–90s sync, 100/day on Plus plan. Pass stream: true to stream raw MP3 bytes as they arrive (~20s TTFB instead of ~60s wall-clock).

# Sync: returns JSON with base64-encoded MP3
curl http://localhost:18080/v1/music/generations \
  -H "Authorization: Bearer sk-test-123" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ail-music",
    "lyrics": "[Verse]\nHello world\n[Chorus]\nLet us sing"
  }' | jq -r .data.audio | base64 -d > song.mp3

# Stream: returns audio/mpeg directly, playable as it downloads
curl -N http://localhost:18080/v1/music/generations \
  -H "Authorization: Bearer sk-test-123" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ail-music",
    "stream": true,
    "lyrics": "[Verse]\nHello world\n[Chorus]\nLet us sing"
  }' > song.mp3

Sync returns {data: {audio: <base64>, duration_ms, sample_rate, channels, bitrate}, model, trace_id}. Streaming returns Content-Type: audio/mpeg with progressive MP3 frames. For cover mode use "model": "ail-music-cover" with "audio_url" or "audio_base64" + "prompt".

Lyrics Generation
curl http://localhost:18080/v1/music/lyrics \
  -H "Authorization: Bearer sk-test-123" \
  -H "Content-Type: application/json" \
  -d '{"mode":"write_full_song","prompt":"happy pop about coding"}'

Returns {song_title, style_tags, lyrics} with [Verse]/[Chorus] structure tags.

Audio Translation (to English)
curl http://localhost:18080/v1/audio/translations \
  -H "Authorization: Bearer sk-test-123" \
  -F file="@german_audio.mp3" \
  -F model="whisper-1"

Advanced Features

switchAILocal passes through all standard and provider-specific parameters, so you can use tools, thinking mode, vision, and more — just like talking directly to the upstream provider.

Built-in tools like web search are forwarded as-is to the upstream. MiniMax M2.7 is the canonical web-search provider — the model runs the search internally and returns the synthesized answer in choices[0].message.content.

Critical: set max_tokens >= 2000 when using web_search. Search results are folded into the prompt and inflate context to 6k–13k tokens — lower budgets produce truncated or empty responses.

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "ail-compound",
    "messages": [
      {"role": "user", "content": "What are the latest AI news today?"}
    ],
    "max_tokens": 2000,
    "tools": [
      {
        "type": "web_search",
        "max_keyword": 3,
        "force_search": true,
        "limit": 3
      }
    ],
    "tool_choice": "auto"
  }'
Function Calling (OpenAI Standard)

Standard OpenAI function calling works with any compatible provider:

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "gemini-2.5-pro",
    "messages": [
      {"role": "user", "content": "What is the weather in Berlin?"}
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_weather",
          "description": "Get current weather for a location",
          "parameters": {
            "type": "object",
            "properties": {
              "location": {"type": "string", "description": "City name"},
              "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
            },
            "required": ["location"]
          }
        }
      }
    ],
    "tool_choice": "auto"
  }'
Thinking / Reasoning Mode

Enable extended thinking for complex reasoning tasks:

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "claudecli:claude-sonnet-4",
    "messages": [
      {"role": "user", "content": "Prove that the square root of 2 is irrational"}
    ],
    "thinking": {
      "type": "enabled",
      "budget_tokens": 10000
    }
  }'
Vision (Image Analysis)

Send images for analysis using the standard multimodal content format:

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "geminicli:gemini-2.5-pro",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "What do you see in this image?"},
          {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
        ]
      }
    ]
  }'
CLI Attachments (Files & Folders)

Pass files and folders directly to CLI providers via extra_body.cli:

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -d '{
    "model": "geminicli:gemini-2.5-pro",
    "messages": [
      {"role": "user", "content": "Review this code for security issues"}
    ],
    "extra_body": {
      "cli": {
        "files": ["/path/to/main.go", "/path/to/server.go"],
        "directories": ["/path/to/internal/"]
      }
    }
  }'
Streaming

All chat endpoints support SSE streaming:

curl http://localhost:18080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-test-123" \
  -N \
  -d '{
    "model": "gemini-2.5-pro",
    "messages": [{"role": "user", "content": "Tell me a story"}],
    "stream": true
  }'

SDK Integration

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:18080/v1",
    api_key="sk-test-123",  # Must match a key in config.yaml
)

# Recommended: Auto-routing (switchAILocal picks the best available provider)
completion = client.chat.completions.create(
    model="gemini-2.5-pro",  # No prefix = auto-route to any logged-in provider
    messages=[
        {"role": "user", "content": "What is the meaning of life?"}
    ]
)
print(completion.choices[0].message.content)

# Streaming example
stream = client.chat.completions.create(
    model="gemini-2.5-pro",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

# Optional: Explicit provider selection (use prefix only when needed)
completion = client.chat.completions.create(
    model="ollama:llama3.2",  # Force Ollama provider
    messages=[{"role": "user", "content": "Hello!"}]
)

JavaScript/Node.js (OpenAI SDK)

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'http://localhost:18080/v1',
  apiKey: 'sk-test-123', // Must match a key in config.yaml
});

async function main() {
  // Auto-routing
  const completion = await client.chat.completions.create({
    model: 'gemini-2.5-pro',
    messages: [
      { role: 'user', content: 'What is the meaning of life?' }
    ],
  });

  console.log(completion.choices[0].message.content);

  // Explicit provider selection
  const ollamaResponse = await client.chat.completions.create({
    model: 'ollama:llama3.2',  // Force Ollama
    messages: [
      { role: 'user', content: 'Hello!' }
    ],
  });
}

main();

Streaming Example (Python)

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:18080/v1",
    api_key="sk-test-123",
)

stream = client.chat.completions.create(
    model="geminicli:gemini-2.5-pro",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Configuration

All settings are in config.yaml. Copy the example to get started:

cp config.example.yaml config.yaml

Key configuration options:

# Server port (default: 18080)
port: 18080

# Enable Ollama integration
ollama:
  enabled: true
  base-url: "http://localhost:11434"

# Enable LM Studio
lmstudio:
  enabled: true
  base-url: "http://localhost:1234/v1"

# Enable LUA plugins for request/response modification
plugin:
  enabled: true
  plugin-dir: "./plugins"

📖 See Configuration Guide for all options.


Cortex Router: Intelligent Model Selection

The Cortex Router plugin provides intelligent, multi-tier routing that automatically selects the optimal model based on request content.

Quick Start

Enable intelligent routing in config.yaml:

plugin:
  enabled: true
  enabled-plugins:
    - "cortex-router"

intelligence:
  enabled: true
  router-model: "ollama:qwen:0.5b"  # Fast classification model
  matrix:
    coding: "switchai-chat"
    reasoning: "switchai-reasoner"
    fast: "switchai-fast"
    secure: "ollama:llama3.2"  # Local model for sensitive data

How It Works

When you use model="auto" or model="cortex", the router analyzes your request through multiple tiers:

  1. Reflex Tier (<1ms): Pattern matching for obvious cases (code blocks → coding model, PII → secure model)
  2. Semantic Tier (<20ms): Embedding-based intent matching (requires Phase 2)
  3. Cognitive Tier (200-500ms): LLM-based classification with confidence scoring
# Automatic intelligent routing
completion = client.chat.completions.create(
    model="auto",  # Let Cortex Router decide
    messages=[{"role": "user", "content": "Write a Python function to sort a list"}]
)
# → Routes to coding model automatically

Phase 2 Features (Optional)

Enable advanced features for even smarter routing:

intelligence:
  enabled: true
  
  # Semantic matching (faster than LLM classification)
  embedding:
    enabled: true
  semantic-tier:
    enabled: true
  
  # Skill-based prompt augmentation
  skill-matching:
    enabled: true
  
  # Quality-based model cascading
  cascade:
    enabled: true

21 Pre-built Skills including:

  • Language experts (Go, Python, TypeScript)
  • Infrastructure (Docker, Kubernetes, DevOps)
  • Security, Testing, Debugging
  • Frontend, Vision, and more

📖 See Cortex Router Phase 2 Guide for full documentation.


Documentation

📚 Read the Official switchAILocal Documentation

For Users

Guide Description
Installation Getting started guide
Performance Guide Rate limiting, load shedding, and profiling
Configuration All configuration options
Providers Setting up AI providers
API Reference REST API documentation
Intelligent Systems Memory, Heartbeat, Steering, and Hooks
Advanced Features Payload overrides, failover, and more
State Box Secure state management & configuration
Management Dashboard Modern web UI for provider setup, model routing & settings

Build from Source

# Recommended: use the setup script
./ail.sh setup

# OR build manually
go build -o switchAILocal ./cmd/server
go build -o bridge-agent ./cmd/bridge-agent

# Build the Management UI (optional)
./ail_ui.sh

For Developers

Guide Description
SDK Usage Embed switchAILocal in your Go apps
LUA Plugins Custom request/response hooks
SDK Advanced Create custom providers

Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes
  4. Push and open a Pull Request

License

MIT License - see LICENSE for details.


Maintained by Sebastian Schkudlara

Directories

Path Synopsis
cmd
bridge-agent command
server command
Package main provides the entry point for the switchAILocal server.
Package main provides the entry point for the switchAILocal server.
examples
advanced command
Package main demonstrates how to create a custom AI provider executor and integrate it with the switchAILocal server.
Package main demonstrates how to create a custom AI provider executor and integrate it with the switchAILocal server.
internal
api
Package api provides the HTTP API server implementation for the switchAILocal.
Package api provides the HTTP API server implementation for the switchAILocal.
api/handlers/management
Package management provides the management API handlers and middleware for configuring the server and managing auth files.
Package management provides the management API handlers and middleware for configuring the server and managing auth files.
api/middleware
Package middleware provides HTTP middleware components for the switchAILocal server.
Package middleware provides HTTP middleware components for the switchAILocal server.
api/modules
Package modules provides a pluggable routing module system for extending the API server with optional features without modifying core routing logic.
Package modules provides a pluggable routing module system for extending the API server with optional features without modifying core routing logic.
api/modules/amp
Package amp implements the Amp CLI routing module, providing OAuth-based integration with Amp CLI for ChatGPT and Anthropic subscriptions.
Package amp implements the Amp CLI routing module, providing OAuth-based integration with Amp CLI for ChatGPT and Anthropic subscriptions.
auth
Package auth provides authentication functionality for various AI service providers.
Package auth provides authentication functionality for various AI service providers.
auth/claude
Package claude provides OAuth2 authentication functionality for Anthropic's Claude API.
Package claude provides OAuth2 authentication functionality for Anthropic's Claude API.
auth/codex
Package codex provides authentication and token management for OpenAI's Codex API.
Package codex provides authentication and token management for OpenAI's Codex API.
auth/empty
Package empty provides a no-operation token storage implementation.
Package empty provides a no-operation token storage implementation.
auth/gemini
Package gemini provides authentication and token management functionality for Google's Gemini AI services.
Package gemini provides authentication and token management functionality for Google's Gemini AI services.
auth/qwen
Package qwen provides authentication and token management functionality for Alibaba's Qwen AI services.
Package qwen provides authentication and token management functionality for Alibaba's Qwen AI services.
auth/vertex
Package vertex provides token storage for Google Vertex AI Gemini via service account credentials.
Package vertex provides token storage for Google Vertex AI Gemini via service account credentials.
browser
Package browser provides cross-platform functionality for opening URLs in the default web browser.
Package browser provides cross-platform functionality for opening URLs in the default web browser.
buildinfo
Package buildinfo exposes compile-time metadata shared across the server.
Package buildinfo exposes compile-time metadata shared across the server.
cli
cmd
Package cmd provides command-line interface functionality for the switchAILocal server.
Package cmd provides command-line interface functionality for the switchAILocal server.
config
Package config provides configuration management for the switchAILocal server.
Package config provides configuration management for the switchAILocal server.
constant
Package constant defines provider name constants used throughout the switchAILocal.
Package constant defines provider name constants used throughout the switchAILocal.
discovery
Package discovery provides model discovery interfaces and implementations.
Package discovery provides model discovery interfaces and implementations.
failover
Package failover classifies upstream-provider errors into a small, well-defined taxonomy that the cross-provider retry loop dispatches on.
Package failover classifies upstream-provider errors into a small, well-defined taxonomy that the cross-provider retry loop dispatches on.
heartbeat
Package heartbeat provides proactive background monitoring for provider health.
Package heartbeat provides proactive background monitoring for provider health.
integration
Package integration provides coordination and lifecycle management for intelligent systems.
Package integration provides coordination and lifecycle management for intelligent systems.
intelligence
Package intelligence provides the Cortex Router for intelligent request routing.
Package intelligence provides the Cortex Router for intelligent request routing.
intelligence/cache
Package cache provides semantic caching for routing decisions.
Package cache provides semantic caching for routing decisions.
intelligence/capability
Package capability provides model capability analysis for the intelligence system.
Package capability provides model capability analysis for the intelligence system.
intelligence/cascade
Package cascade provides model cascading functionality for intelligent routing.
Package cascade provides model cascading functionality for intelligent routing.
intelligence/discovery
Package discovery provides model discovery services for the intelligence system.
Package discovery provides model discovery services for the intelligence system.
intelligence/embedding
Package embedding provides an ONNX-based embedding engine for semantic matching.
Package embedding provides an ONNX-based embedding engine for semantic matching.
intelligence/feedback
Package feedback provides feedback collection and storage for routing decisions.
Package feedback provides feedback collection and storage for routing decisions.
intelligence/matrix
Package matrix provides dynamic capability matrix building for the intelligence system.
Package matrix provides dynamic capability matrix building for the intelligence system.
intelligence/semantic
Package semantic provides semantic intent matching for Phase 2 intelligent routing.
Package semantic provides semantic intent matching for Phase 2 intelligent routing.
intelligence/skills
Package skills provides an enhanced skill registry for Phase 2 intelligent routing.
Package skills provides an enhanced skill registry for Phase 2 intelligent routing.
interfaces
Package interfaces defines the core interfaces and shared structures for the switchAILocal server.
Package interfaces defines the core interfaces and shared structures for the switchAILocal server.
logging
Package logging provides Gin middleware for HTTP request logging and panic recovery.
Package logging provides Gin middleware for HTTP request logging and panic recovery.
memory
Package memory provides persistent storage for routing decisions, provider quirks, and user preferences.
Package memory provides persistent storage for routing decisions, provider quirks, and user preferences.
misc
Package misc provides miscellaneous utility functions and embedded data for the switchAILocal.
Package misc provides miscellaneous utility functions and embedded data for the switchAILocal.
observability
Package observability provides structured event logging, metrics, and tracing for integrating switchAILocal with external monitoring systems.
Package observability provides structured event logging, metrics, and tracing for integrating switchAILocal with external monitoring systems.
performance/loadshed
Package loadshed provides graceful load shedding middleware for the switchAILocal proxy.
Package loadshed provides graceful load shedding middleware for the switchAILocal proxy.
performance/ratelimit
Package ratelimit provides token-bucket rate limiting for the switchAILocal proxy.
Package ratelimit provides token-bucket rate limiting for the switchAILocal proxy.
plugin
Package plugin provides LUA-based plugin support for extending switchAILocal functionality.
Package plugin provides LUA-based plugin support for extending switchAILocal functionality.
registry
Package registry provides model definitions for various AI service providers.
Package registry provides model definitions for various AI service providers.
runtime/executor
Package executor provides runtime execution capabilities for various AI service providers.
Package executor provides runtime execution capabilities for various AI service providers.
runtime/opencode
Package opencode provides a client for interacting with the OpenCode server API.
Package opencode provides a client for interacting with the OpenCode server API.
superbrain
Package superbrain provides intelligent orchestration and self-healing capabilities for the switchAILocal gateway.
Package superbrain provides intelligent orchestration and self-healing capabilities for the switchAILocal gateway.
superbrain/audit
Package audit provides structured logging for Superbrain autonomous actions.
Package audit provides structured logging for Superbrain autonomous actions.
superbrain/doctor
Package doctor provides AI-powered failure diagnosis for the Superbrain system.
Package doctor provides AI-powered failure diagnosis for the Superbrain system.
superbrain/injector
Package injector provides autonomous stdin injection capabilities for the Superbrain system.
Package injector provides autonomous stdin injection capabilities for the Superbrain system.
superbrain/metadata
Package metadata provides functionality for aggregating and managing healing metadata throughout the request lifecycle.
Package metadata provides functionality for aggregating and managing healing metadata throughout the request lifecycle.
superbrain/metrics
Package metrics provides observability infrastructure for the Superbrain system.
Package metrics provides observability infrastructure for the Superbrain system.
superbrain/overwatch
Package overwatch provides real-time execution monitoring capabilities for the Superbrain system.
Package overwatch provides real-time execution monitoring capabilities for the Superbrain system.
superbrain/recovery
Package recovery provides process recovery and restart capabilities for the Superbrain system.
Package recovery provides process recovery and restart capabilities for the Superbrain system.
superbrain/response
Package response provides response enrichment capabilities for the Superbrain system.
Package response provides response enrichment capabilities for the Superbrain system.
superbrain/router
Package router provides intelligent failover routing between AI providers.
Package router provides intelligent failover routing between AI providers.
superbrain/sculptor
Package sculptor provides pre-flight content analysis and optimization for the Superbrain system.
Package sculptor provides pre-flight content analysis and optimization for the Superbrain system.
superbrain/security
Package security provides security controls and fail-safes for the Superbrain system.
Package security provides security controls and fail-safes for the Superbrain system.
superbrain/types
Package types provides shared type definitions for the Superbrain system.
Package types provides shared type definitions for the Superbrain system.
translator/antigravity/claude
Package claude provides request translation functionality for Claude Code API compatibility.
Package claude provides request translation functionality for Claude Code API compatibility.
translator/antigravity/gemini
Package gemini provides request translation functionality for Gemini CLI to Gemini API compatibility.
Package gemini provides request translation functionality for Gemini CLI to Gemini API compatibility.
translator/antigravity/openai/chat-completions
Package openai provides request translation functionality for OpenAI to Gemini CLI API compatibility.
Package openai provides request translation functionality for OpenAI to Gemini CLI API compatibility.
translator/claude/gemini
Package gemini provides request translation functionality for Gemini to Claude Code API compatibility.
Package gemini provides request translation functionality for Gemini to Claude Code API compatibility.
translator/claude/gemini-cli
Package geminiCLI provides request translation functionality for Gemini CLI to Claude Code API compatibility.
Package geminiCLI provides request translation functionality for Gemini CLI to Claude Code API compatibility.
translator/claude/openai/chat-completions
Package openai provides request translation functionality for OpenAI to Claude Code API compatibility.
Package openai provides request translation functionality for OpenAI to Claude Code API compatibility.
translator/codex/claude
Package claude provides request translation functionality for Claude Code API compatibility.
Package claude provides request translation functionality for Claude Code API compatibility.
translator/codex/gemini
Package gemini provides request translation functionality for Codex to Gemini API compatibility.
Package gemini provides request translation functionality for Codex to Gemini API compatibility.
translator/codex/gemini-cli
Package geminiCLI provides request translation functionality for Gemini CLI to Codex API compatibility.
Package geminiCLI provides request translation functionality for Gemini CLI to Codex API compatibility.
translator/codex/openai/chat-completions
Package openai provides utilities to translate OpenAI Chat Completions request JSON into OpenAI Responses API request JSON using gjson/sjson.
Package openai provides utilities to translate OpenAI Chat Completions request JSON into OpenAI Responses API request JSON using gjson/sjson.
translator/gemini-cli/claude
Package claude provides request translation functionality for Claude Code API compatibility.
Package claude provides request translation functionality for Claude Code API compatibility.
translator/gemini-cli/gemini
Package gemini provides request translation functionality for Gemini CLI to Gemini API compatibility.
Package gemini provides request translation functionality for Gemini CLI to Gemini API compatibility.
translator/gemini-cli/openai/chat-completions
Package openai provides request translation functionality for OpenAI to Gemini CLI API compatibility.
Package openai provides request translation functionality for OpenAI to Gemini CLI API compatibility.
translator/gemini/claude
Package claude provides request translation functionality for Claude API.
Package claude provides request translation functionality for Claude API.
translator/gemini/gemini
Package gemini provides in-provider request normalization for Gemini API.
Package gemini provides in-provider request normalization for Gemini API.
translator/gemini/gemini-cli
Package gemini provides request translation functionality for Claude API.
Package gemini provides request translation functionality for Claude API.
translator/gemini/openai/chat-completions
Package openai provides request translation functionality for OpenAI to Gemini API compatibility.
Package openai provides request translation functionality for OpenAI to Gemini API compatibility.
translator/openai/claude
Package claude provides request translation functionality for Anthropic to OpenAI API.
Package claude provides request translation functionality for Anthropic to OpenAI API.
translator/openai/gemini
Package gemini provides request translation functionality for Gemini to OpenAI API.
Package gemini provides request translation functionality for Gemini to OpenAI API.
translator/openai/gemini-cli
Package geminiCLI provides request translation functionality for Gemini to OpenAI API.
Package geminiCLI provides request translation functionality for Gemini to OpenAI API.
translator/openai/openai/chat-completions
Package openai provides request translation functionality for OpenAI to Gemini CLI API compatibility.
Package openai provides request translation functionality for OpenAI to Gemini CLI API compatibility.
translator/translator
Package translator provides request and response translation functionality between different AI API formats.
Package translator provides request and response translation functionality between different AI API formats.
usage
Package usage provides usage tracking and logging functionality for the switchAILocal server.
Package usage provides usage tracking and logging functionality for the switchAILocal server.
util
Package util provides utility functions for the switchAILocal server.
Package util provides utility functions for the switchAILocal server.
virtualmodels
Package virtualmodels implements public virtual model pools such as ail-compound.
Package virtualmodels implements public virtual model pools such as ail-compound.
watcher
clients.go implements watcher client lifecycle logic and persistence helpers.
clients.go implements watcher client lifecycle logic and persistence helpers.
watcher/synthesizer
Package synthesizer provides auth synthesis strategies for the watcher package.
Package synthesizer provides auth synthesis strategies for the watcher package.
sdk
api
Package api exposes server option helpers for embedding switchAILocal.
Package api exposes server option helpers for embedding switchAILocal.
api/handlers
Package handlers provides core API handler functionality for the switchAILocal server.
Package handlers provides core API handler functionality for the switchAILocal server.
api/handlers/claude
Package claude provides HTTP handlers for Claude API code-related functionality.
Package claude provides HTTP handlers for Claude API code-related functionality.
api/handlers/gemini
Package gemini provides HTTP handlers for Gemini CLI API functionality.
Package gemini provides HTTP handlers for Gemini CLI API functionality.
api/handlers/notifications
Package notifications implements outbound notification relays so sandboxed clients (Tytus pods, restricted agents, etc.) can emit messages to external services like Telegram without ever holding the upstream credentials.
Package notifications implements outbound notification relays so sandboxed clients (Tytus pods, restricted agents, etc.) can emit messages to external services like Telegram without ever holding the upstream credentials.
api/handlers/openai
Package openai provides HTTP handlers for OpenAI API endpoints.
Package openai provides HTTP handlers for OpenAI API endpoints.
config
Package config provides the public SDK configuration API.
Package config provides the public SDK configuration API.
logging
Package logging re-exports request logging primitives for SDK consumers.
Package logging re-exports request logging primitives for SDK consumers.
switchailocal
Package switchailocal provides the core service implementation for the switchAILocal.
Package switchailocal provides the core service implementation for the switchAILocal.
translator
Package translator provides types and functions for converting chat requests and responses between different schemas.
Package translator provides types and functions for converting chat requests and responses between different schemas.
translator/builtin
Package builtin exposes the built-in translator registrations for SDK users.
Package builtin exposes the built-in translator registrations for SDK users.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL