Skip to main content

Ollama AI Provider Plugin

The Ollama plugin connects Ever Works to a local or remote Ollama server for self-hosted AI inference. It extends BaseAiProvider and uses the shared AiOperations layer that wraps LangChain under the hood.

Source: packages/plugins/ollama/src/ollama.plugin.ts

Overview

PropertyValue
Plugin IDollama
Categoryai-provider
Capabilitiesai-provider
Version1.0.0
Configuration Modeuser-required
Provider Typeollama
Auto-enableNo
Built-inYes
Visibilitypublic

The plugin extends BaseAiProvider from @ever-works/plugin/abstract and creates an AiOperations instance from @ever-works/plugin/ai to handle all AI operations through a unified LangChain-based abstraction. Unlike cloud-hosted providers, Ollama typically does not require an API key.

Architecture

The plugin talks to Ollama through its OpenAI-compatible /v1 API endpoint. This means any model served by Ollama that exposes this endpoint works without additional configuration.

Configuration

Settings Schema

SettingTypeDefaultScopeDescription
baseUrlstringhttp://localhost:11434/v1userAddress of the Ollama instance
apiKeystringollamauserOnly needed for secured Ollama instances
defaultModelstringministral-3:8bglobalUsed for all AI tasks unless a tier-specific model is set
simpleModelstringministral-3:8bglobalHandles tags, short descriptions, and quick classifications
mediumModelstringministral-3:8bglobalHandles listings, summaries, and content reformatting
complexModelstringministral-3:8bglobalHandles full page generation and multi-step analysis
temperaturenumber0.7hiddenControls output randomness (0 = deterministic, 2 = creative)
maxTokensnumber4096hiddenMaximum length of each AI-generated response

Model fields use the x-widget: model-select extension, which renders the model-select dropdown in the dashboard UI. The dropdown is populated by calling listModels() against the configured Ollama instance.

Required Fields

  • baseUrl -- the Ollama server address
  • defaultModel -- at least one model must be selected

Schema Extensions

{
"defaultModel": {
"type": "string",
"title": "Default Model",
"default": "ministral-3:8b",
"x-widget": "model-select",
"x-scope": "global"
}
}

The x-scope: global extension means model selection applies platform-wide rather than per-user. The x-hidden: true extension on temperature and maxTokens keeps those fields out of the standard settings UI.

Model Capabilities

getCapabilities(): AiModelCapabilities {
return {
supportsStructuredOutput: true,
supportsStreaming: true,
supportsToolCalling: true,
supportsVision: true,
maxContextLength: 128000
};
}
CapabilitySupported
Structured output (JSON mode)Yes
Streaming responsesYes
Tool callingYes
Vision (image input)Yes
EmbeddingsYes
Max context length128,000 tokens

Ollama supports embeddings through models such as nomic-embed-text. The createEmbedding() method delegates to AiOperations.createEmbedding().

Tiered Model Assignment

Ever Works uses a three-tier model system to balance speed and quality during work generation:

TierUse CasesRecommended Models
SimpleTags, short descriptions, classificationsministral-3:8b, gemma2:2b
MediumListings, summaries, content reformattingministral-3:8b, llama3.1:8b
ComplexFull page generation, multi-step analysisllama3.1:70b, mistral-large

If a tier-specific model is not set, the defaultModel is used for all tiers.

Lifecycle

Loading

async onLoad(context: PluginContext): Promise<void> {
await super.onLoad(context);
this.aiOps = new AiOperations({
apiKey: 'ollama',
model: 'ministral-3:8b',
baseURL: 'http://localhost:11434/v1',
temperature: 0.7,
maxTokens: 4096,
providerType: 'ollama'
});
}

On load, the plugin creates an AiOperations instance with default values. When a request arrives, resolveConfig() merges the user's saved settings on top of these defaults before executing.

Availability Check

The isAvailable() method calls AiOperations.testConnection() with the resolved configuration to verify the Ollama server is reachable and responding.

API Methods

MethodDescription
createChatCompletion(options)Single chat completion request
createStreamingChatCompletion(options)Streaming chat completion (async generator)
createEmbedding(options)Generate text embeddings
listModels(settings)List available models from the Ollama instance
isAvailable(settings)Test connection to the Ollama server
getCapabilities()Return supported capabilities
healthCheck()Return plugin health status

Getting Started

  1. Install and run Ollama from ollama.com or connect to an existing instance.
  2. Pull at least one model: ollama pull ministral-3:8b.
  3. Enable the Ollama plugin in the Ever Works dashboard under Settings > Plugins.
  4. Set the Ollama Server URL to your instance address (defaults to http://localhost:11434/v1).
  5. Select your preferred models for each task complexity tier.
  6. Ollama will be used automatically during work generation and AI conversations.

Troubleshooting

IssueCauseSolution
Plugin shows unavailableOllama server not runningStart Ollama with ollama serve
No models in dropdownNo models pulledRun ollama pull <model-name>
Connection refusedWrong base URLVerify the URL includes /v1 (e.g., http://localhost:11434/v1)
Slow responsesModel too large for hardwareUse a smaller model or increase available RAM/VRAM
Embedding errorsModel does not support embeddingsSwitch to an embedding model like nomic-embed-text