Skip to main content
PluginShippedclawql-inference/plugin

Plugins · Registry · Plugin model

Inference providers

Inference backends are provider plugins on clawql-inference. The core package stays lean: gateway, routing, catalog, and a registry. Built-in defaults register automatically; integrators and third parties add more via the same plugin contract.

Default posture: bring your own vendor keys (BYOK). ClawQL routes provider/model directly to DeepSeek, Groq, Fireworks, Together, Mistral, xAI, Google, OpenAI, Anthropic, and local Ollama. OpenRouter is optional — keep using it through ClawQL if you prefer that aggregator, but it is never required.

Built-in defaults (automatic)

composeDefaultProviderPlugins() registers these unless disabled:

Plugin idAdapterCredentials / config
openaiChat completionsOPENAI_API_KEY, CLAWQL_OPENAI_BASE_URL
anthropicMessages APIANTHROPIC_API_KEY, CLAWQL_ANTHROPIC_BASE_URL
ollamaLocal /api/chatOLLAMA_BASE_URL (default http://127.0.0.1:11434)
deepseekOpenAI-compatible (direct)DEEPSEEK_API_KEY, CLAWQL_DEEPSEEK_BASE_URL
groqOpenAI-compatible (direct)GROQ_API_KEY, CLAWQL_GROQ_BASE_URL
fireworksOpenAI-compatible (direct)FIREWORKS_API_KEY, CLAWQL_FIREWORKS_BASE_URL
togetherOpenAI-compatible (direct)TOGETHER_API_KEY, CLAWQL_TOGETHER_BASE_URL
mistralOpenAI-compatible (direct)MISTRAL_API_KEY, CLAWQL_MISTRAL_BASE_URL
xaiOpenAI-compatible (direct)XAI_API_KEY, CLAWQL_XAI_BASE_URL
googleGemini OpenAI-compat endpointGOOGLE_API_KEY, CLAWQL_GOOGLE_OPENAI_BASE_URL
openrouterOptional aggregator escape hatchOPENROUTER_API_KEY, CLAWQL_OPENROUTER_BASE_URL (default https://openrouter.ai/api/v1)

Model ids use provider/model (e.g. deepseek/deepseek-chat, anthropic/claude-sonnet-4, ollama/phi4). Catalog aliases such as clawql/cheap-chat resolve to direct BYOK models.

OpenRouter catalog ids keep the vendor path only when you opt in: openrouter/deepseek/deepseek-chat, openrouter/qwen/qwen3.6-plus.

Direct BYOK quick start (preferred)

export DEEPSEEK_API_KEY=sk-…
clawql inference serve --port 8080

curl -s http://127.0.0.1:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"deepseek/deepseek-chat","messages":[{"role":"user","content":"hi"}]}'

# Or use a ClawQL alias
curl -s http://127.0.0.1:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"clawql/cheap-chat","messages":[{"role":"user","content":"hi"}]}'

OpenRouter escape hatch (optional)

export OPENROUTER_API_KEY=sk-or-…
# Optional allowlist if you only want the aggregator registered:
# export CLAWQL_INFERENCE_PROVIDERS=openrouter
clawql inference serve --port 8080

curl -s http://127.0.0.1:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"openrouter/deepseek/deepseek-chat","messages":[{"role":"user","content":"hi"}]}'

Optional attribution headers: CLAWQL_OPENROUTER_HTTP_REFERER, CLAWQL_OPENROUTER_APP_TITLE.

Enable / disable plugins

EnvEffect
CLAWQL_INFERENCE_PROVIDERS=openai,deepseekAllowlist — only listed provider plugins register
CLAWQL_INFERENCE_DISABLE_PROVIDERS=openrouterDenylist — skip listed builtins

Plugin contract

import type { InferenceProviderPlugin } from 'clawql-inference'

export function createAcmeProviderPlugin(): InferenceProviderPlugin {
  return {
    id: 'acme',
    version: '1.0.0',
    onRegister({ env, registry }) {
      registry.set('acme', createAcmeAdapter({ apiKey: env.ACME_API_KEY }))
    },
  }
}

Compose builtins + extensions:

import {
  composeProviderPlugins,
  createInferenceGateway,
  createProviderRegistry,
} from 'clawql-inference'

const gateway = createInferenceGateway({
  providers: createProviderRegistry({
    env: process.env,
    plugins: composeProviderPlugins({
      extensions: [createAcmeProviderPlugin()],
    }),
  }),
})

Publish third-party packages as clawql-*-inference-provider (or in-repo under packages/) and pass them to composeProviderPlugins(\{ extensions: [...] \}) — same pattern as horizontal MCP plugins, without runtime npm discovery.

Subpath export

  • clawql-inference/plugin — builtins, compose helpers, adapter factories for authors

Learn more