Skip to main content

AI Provider Plugins

AI provider plugins connect the Ever Works platform to large language model APIs for content generation, structured output, embeddings, and conversational AI. All AI providers implement the IAiProviderPlugin interface and extend the BaseAiProvider abstract class.

Architecture

Every AI provider plugin follows the same pattern:

  1. Extends BaseAiProvider from @ever-works/plugin/abstract
  2. Uses AiOperations from @ever-works/plugin/ai (wraps LangChain for all providers)
  3. Declares the ai-provider capability
  4. Defines settings via JSON Schema with x-secret, x-widget, and x-scope extensions
import { BaseAiProvider } from '@ever-works/plugin/abstract';
import { AiOperations } from '@ever-works/plugin/ai';

export class MyProviderPlugin extends BaseAiProvider {
readonly id = 'my-provider';
readonly name = 'My Provider';
readonly version = '1.0.0';
readonly providerType = 'my-provider';
readonly providerName = 'My Provider';

async onLoad(context: PluginContext): Promise<void> {
await super.onLoad(context);
this.aiOps = new AiOperations({
apiKey: '',
model: 'default-model',
temperature: 0.7,
providerType: 'my-provider'
});
}

async createChatCompletion(options: ChatCompletionOptions) {
return this.aiOps!.createChatCompletion(options, this.resolveConfig(options.settings));
}

async listModels(settings?: PluginSettings) {
return this.aiOps!.listModels(this.resolveConfig(settings));
}

protected getDefaultModelId(): string {
return 'default-model';
}
}

The AiOperations Wrapper

AiOperations is the shared AI abstraction layer that wraps LangChain. Every provider creates an instance during onLoad() and delegates calls to it. This means providers do not interact with LangChain directly -- they configure AiOperations with their provider type, API key, and base URL, and it handles the rest.

Key operations provided by AiOperations:

  • createChatCompletion() -- standard chat completion
  • askJson() -- structured JSON output using a Zod schema
  • createStreamingChatCompletion() -- streaming responses
  • createEmbedding() -- text embeddings
  • listModels() -- list available models
  • testConnection() -- verify API key and connectivity

Settings Resolution

The resolveConfig() method on BaseAiProvider converts plugin settings into AiOperationsConfig overrides:

protected resolveConfig(settings?: PluginSettings): Partial<AiOperationsConfig> {
const config: Partial<AiOperationsConfig> = {};
if (settings?.apiKey) config.apiKey = settings.apiKey as string;
if (settings?.defaultModel) config.model = settings.defaultModel as string;
if (settings?.baseUrl) config.baseURL = settings.baseUrl as string;
if (settings?.temperature !== undefined) config.temperature = settings.temperature as number;
if (settings?.maxTokens !== undefined) config.maxTokens = settings.maxTokens as number;
return config;
}

Available Providers

OpenAI

PropertyValue
Package@ever-works/openai-plugin
Provider Typeopenai
Configuration Modeuser-required
Default Modelgpt-5.1
Structured OutputYes
StreamingYes
Tool CallingYes
VisionYes
EmbeddingsYes
Max Context128,000 tokens

Supports tiered model selection: simpleModel (gpt-5-nano), mediumModel (gpt-4o-mini), complexModel (gpt-5.1). Each tier is used for different task complexity levels during generation.

Anthropic

PropertyValue
Package@ever-works/anthropic-plugin
Provider Typeanthropic
Configuration Modeuser-required
Default ModelClaude series
Structured OutputYes
StreamingYes
Tool CallingYes
VisionYes
EmbeddingsNo

Google (Gemini)

PropertyValue
Package@ever-works/google-plugin
Provider Typegoogle
Configuration Modeuser-required
Default ModelGemini series
Structured OutputYes
StreamingYes
Tool CallingYes
VisionYes
EmbeddingsYes

Groq

PropertyValue
Package@ever-works/groq-plugin
Provider Typegroq
Configuration Modeuser-required
Default ModelGroq-hosted models
Structured OutputYes
StreamingYes
Tool CallingYes
VisionDepends on model
EmbeddingsNo

Groq provides extremely fast inference through custom LPU hardware. Ideal for latency-sensitive tasks.

Ollama

PropertyValue
Package@ever-works/ollama-plugin
Provider Typeollama
Configuration Modeuser-required
Default ModelUser's local models
Structured OutputModel dependent
StreamingYes
Tool CallingModel dependent
VisionModel dependent
EmbeddingsModel dependent

Ollama runs models locally. Users must have Ollama installed and running. The baseUrl setting (default: http://localhost:11434) points to the local Ollama instance.

LM Studio

PropertyValue
Package@ever-works/lm-studio-plugin
Provider Typelm-studio
Configuration Modeuser-required
Default ModelUser's loaded model
Structured OutputModel dependent
StreamingYes
Tool CallingModel dependent
VisionModel dependent
EmbeddingsModel dependent

LM Studio runs models locally and serves them through an OpenAI-compatible API. Start the Local Server in the LM Studio app; the baseUrl setting (default: http://localhost:1234/v1) points to it. No API key is required by default. The model fields have no hardcoded default — they are populated from the currently loaded model via the model-select widget.

vLLM

PropertyValue
Package@ever-works/vllm-plugin
Provider Typevllm
Configuration Modeuser-required
Default ModelServer's --model
Structured OutputModel dependent
StreamingYes
Tool CallingModel dependent
VisionModel dependent
EmbeddingsModel dependent

vLLM is a high-throughput inference server, usually deployed on a GPU host. It exposes an OpenAI-compatible API; the baseUrl setting (default: http://localhost:8000/v1) points to it. The apiKey field defaults to vLLM's EMPTY placeholder and is only needed when the server was started with --api-key (it is stored encrypted via x-secret). For the managed cloud to reach a vLLM server, the base URL must be resolvable from where work generation runs — see the vLLM plugin page for the networking note.

Mistral

PropertyValue
Package@ever-works/mistral-plugin
Provider Typemistral
Configuration Modeuser-required
Default ModelMistral series
Structured OutputYes
StreamingYes
Tool CallingYes
VisionModel dependent
EmbeddingsYes

Perplexity

PropertyValue
Package@ever-works/perplexity-plugin
Provider Typeperplexity
Configuration Modehybrid
Default ModelPerplexity online models
Structured OutputLimited
StreamingYes
Tool CallingNo
VisionNo
EmbeddingsNo

Perplexity specializes in search-augmented AI responses with built-in web citations.

OpenRouter

PropertyValue
Package@ever-works/openrouter-plugin
Provider Typeopenrouter
Configuration Modeuser-required
Default ModelVaries (multi-provider access)
Structured OutputModel dependent
StreamingYes
Tool CallingModel dependent
VisionModel dependent
EmbeddingsNo

OpenRouter aggregates multiple AI providers behind a single API. It overrides resolveConfig() to handle provider-specific model mapping.

Vercel AI Gateway

PropertyValue
Package@ever-works/vercel-ai-gateway-plugin
Provider Typevercel-ai-gateway
Configuration Modeuser-required
Default ModelRouted through Vercel
Structured OutputModel dependent
StreamingYes
Tool CallingModel dependent
VisionModel dependent
EmbeddingsNo

Routes requests through the Vercel AI Gateway for caching, rate limiting, and observability.

Common Settings Schema

All AI provider plugins share a common settings pattern:

{
"apiKey": { "type": "string", "x-secret": true, "x-scope": "user" },
"defaultModel": { "type": "string", "x-widget": "model-select", "x-scope": "global" },
"simpleModel": { "type": "string", "x-widget": "model-select", "x-scope": "global" },
"mediumModel": { "type": "string", "x-widget": "model-select", "x-scope": "global" },
"complexModel": { "type": "string", "x-widget": "model-select", "x-scope": "global" },
"temperature": { "type": "number", "default": 0.7, "minimum": 0, "maximum": 2 },
"maxTokens": { "type": "number", "default": 4096 },
"baseUrl": { "type": "string", "x-hidden": true }
}

The x-widget: 'model-select' annotation tells the UI to render a model picker that queries listModels().

Model Capabilities

Each model reports its capabilities through the AiModelCapabilities interface:

interface AiModelCapabilities {
supportsStructuredOutput: boolean;
supportsStreaming: boolean;
supportsToolCalling: boolean;
supportsVision: boolean;
maxContextLength: number;
maxOutputTokens?: number;
}

The platform uses these capabilities to decide which models are suitable for specific generation tasks. For example, structured output is required for the item extraction step, and vision is used for analyzing screenshots.

Provider Selection and Fallback

The AiFacadeService in the agent package consumes AI provider plugins. When a generation request specifies an AI provider, the facade:

  1. Resolves user/work-scoped settings for the selected provider
  2. Passes settings in every operation call (e.g., ChatCompletionOptions.settings)
  3. The plugin uses resolveConfig(settings) to build the final AiOperationsConfig

If the selected provider is unavailable, the platform can fall back to another configured provider based on the isAvailable() check.

Creating a Custom AI Provider

To add a new AI provider:

  1. Create a new package in packages/plugins/your-provider/
  2. Add @ever-works/plugin as a peer dependency
  3. Extend BaseAiProvider and implement the required abstract methods
  4. Configure AiOperations with your provider's type and base URL
  5. Define the settings schema with API key and model configuration
  6. Export the plugin class as the default export

See the Creating a Plugin guide for the full scaffolding process.