Skip to main content
PluginShippedclawql-inference/plugin

Plugins hub · Registry reference

Inference providers

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

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)

Model ids use provider/model (e.g. anthropic/claude-sonnet-4, ollama/phi4).

Enable / disable plugins

EnvEffect
CLAWQL_INFERENCE_PROVIDERS=openai,anthropicAllowlist — only listed provider plugins register
CLAWQL_INFERENCE_DISABLE_PROVIDERS=ollamaDenylist — skip listed builtins

Plugin contract

import type { InferenceProviderPlugin } from 'clawql-inference'

export function createGroqProviderPlugin(): InferenceProviderPlugin {
  return {
    id: 'groq',
    version: '1.0.0',
    onRegister({ env, registry }) {
      registry.set('groq', createGroqAdapter({ apiKey: env.GROQ_API_KEY }))
    },
  }
}

Compose builtins + extensions:

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

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

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