Guides running local Ollama models with CrestApps.Core 2.0: registration, connection setup, deployment configuration with Features, toolCalling, and troubleshooting.
Ships in crestapps-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The CrestApps.Core.AI.Ollama package uses OllamaApiClient (OllamaSharp) to talk to a local or self-hosted Ollama server. No API key is involved; data stays on your infrastructure.
Endpoint is required. There is no built-in default; a connection without one fails when a client is created.toolCalling only for models that support tools (for example llama3.1, llama3.2, qwen2.5, mistral), and imageInput only for multimodal models such as llava.using CrestApps.Core.AI.Ollama;
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddOllama()
)
);
Raw registration:
builder.Services
.AddCoreAIServices()
.AddCoreAIOrchestration()
.AddCoreAIOllama();
It registers OllamaAIClientProvider, the ProviderAICompletionClient<OllamaClientMarker> completion client, a connection source, and a deployment provider for OllamaConstants.ClientName ("Ollama").
{
"CrestApps": {
"AI": {
"Connections": [
{
"Name": "local-ollama",
"ClientName": "Ollama",
"Endpoint": "http://localhost:11434"
}
],
"Deployments": [
{
"ClientName": "Ollama",
"ConnectionName": "local-ollama",
"Name": "llama3.1",
"Features": [ "textGeneration", "toolCalling", "streaming" ]
},
{
"ClientName": "Ollama",
"ConnectionName": "local-ollama",
"Name": "phi3",
"Features": [ "textGeneration", "streaming" ]
},
{
"ClientName": "Ollama",
"ConnectionName": "local-ollama",
"Name": "nomic-embed-text",
"Features": [ "textEmbedding" ]
}
]
}
}
}
Name (or ModelName, which falls back to Name) must match the pulled Ollama model tag.Features and no legacy Purpose/Type is skipped with the warning "declares no model capabilities".ChatDeploymentName always declares textGeneration, toolCalling and streaming. Use an explicit Deployments entry for a model that cannot call tools, otherwise the model receives tools it cannot use.UtilityDeploymentName (textGeneration, streaming) and EmbeddingDeploymentName (textEmbedding) work the same way.Point the slot defaults at the local models:
using CrestApps.Core.AI.Models;
builder.Services.Configure<DefaultAIDeploymentSettings>(settings =>
{
settings.DefaultChatDeploymentName = "llama3.1";
settings.DefaultUtilityDeploymentName = "phi3";
settings.DefaultEmbeddingDeploymentName = "nomic-embed-text";
});
using CrestApps.Core.AI.Deployments;
using CrestApps.Core.AI.Models;
namespace MyApp.Services;
public sealed class LocalModelSelector
{
private readonly IAIDeploymentManager _deploymentManager;
public LocalModelSelector(IAIDeploymentManager deploymentManager)
{
_deploymentManager = deploymentManager;
}
public ValueTask<AIDeployment> GetUtilityModelAsync(CancellationToken cancellationToken = default)
=> _deploymentManager.ResolveSlotAsync(
AIDeploymentSlotNames.Utility,
clientName: "Ollama",
cancellationToken: cancellationToken);
}
The utility slot falls back to the chat slot, so background work (titles, extraction, query rewriting) runs on the chat model when no utility model is set.
Requests go through the named HttpClient OllamaConstants.HttpClientName ("CrestApps.Ollama"), which keeps the default HttpClient settings Ollama always used. Configure a client of that name after registering the provider (for example AddHttpClient(name).ConfigurePrimaryHttpMessageHandler(...) with a ConnectCallback that checks each connection's address, AllowAutoRedirect = false, UseCookies = false and a PooledConnectionLifetime) to choose the transport; see crestapps-core-ai-runtime. SDK clients are cached per container in AIProviderClientCache; call Clear() on it instead of the removed static OllamaAIClientProvider.ClearCache().
# CPU
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
# NVIDIA GPU
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
docker exec -it ollama ollama pull llama3.1
docker exec -it ollama ollama pull nomic-embed-text
curl http://localhost:11434/api/tags
The CrestApps.Core repository's Aspire AppHost (src/Startup/CrestApps.Core.Aspire.AppHost) can start Ollama alongside the sample hosts.
Endpoint errors when the first chat runs: the connection has no Endpoint. Add http://localhost:11434 or the server URL.Features, an unknown ClientName, or the slot requires a capability the entry does not declare.toolCalling is not declared and tools were stripped. Pick a tool-capable model and declare it.ModelName."Purpose": "Chat" with "Features": [ "textGeneration", "streaming" ], adding toolCalling only for tool-capable models. Legacy Purpose, Capability and Type values still load, but the projection is narrow: Chat or Utility becomes textGeneration only (not when realtime is declared), and Embedding, Image, Vision, SpeechToText and TextToSpeech become textEmbedding, imageOutput, imageInput, speechToText and textToSpeech. A 1.x chat entry therefore loses tool calling and streaming until toolCalling and streaming are declared.ResolveOrDefaultAsync(AIDeploymentPurpose.X, ...) with ResolveSlotAsync(AIDeploymentSlotNames.X, ...) and purpose lookups with GetAllBySlotAsync.What SKILL.md sets; muted values are Claude Code's defaults
/crestapps-core:crestapps-core-ollamafrom crestapps-core
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-core51 skills in this plugin
/crestapps-core-a2aSkill for Agent-to-Agent (A2A) protocol support in CrestApps.Core on the A2A 1.0 SDK. Covers AddA2AClient and AddCoreAIA2AClient with Entity Framework Core or YesSql connection stores, A2AConnection and A2AConnectionMetadata authentication, AIProfileA2AMetadata, the agent card cache and A2AToolRegistryProvider, the listAvailableAgents, findAgentForTask and findToolsForTask tools, building an A2A host with IAgentHandler, A2AServer, ITaskStore and MapA2A, A2A 1.0 agent cards with supportedInterfaces published at /.well-known/agent-card.json, A2AHostOptions authentication and ExposeAgentsAsSkill, system agents exposed through the host, and upgrading from the 0.3 SDK./crestapps-core-ag-uiSkill for running the CrestApps.Core 2.0 AI chat as an AG-UI agent. Covers the CrestApps.Core.AI.AGUI package (AGUIRunEventWriter, AGUIRunRequest, AGUIJson), AIChatHubCore.RunAgent over SignalR and MapAGUIChat with Server-Sent Events, the RunAgentInput members and streamed events, tool approvals with RequireApproval or an approval tool kind, ApprovalRequiredAIFunction, interrupts and resume, approvals inside agents, page context with crestAppsAGUI.registerContextProvider, shared state with registerStateProvider and update_shared_state, frontend tools, stored tool calls (ChatTurnToolActivity), runs that continue on the next page, AGUIChatOptions.DisconnectedRunTimeout, the protocol and sendPageContext chat options, and the AICompletionContextKeys and ChatResponseHandlerContext members. Use it when showing tool calls in the chat, asking a person before a tool runs, sharing page state with the agent, connecting CopilotKit or another AG-UI client, or troubleshooting approvals and continued runs.Other plugins' skills for the same job