crestapps/crestapps.agentskills/crestapps-core-ai-runtime
Claude Code and agent skill by crestapps/crestapps.agentskills
- community
Checking that the SKILL.md file is still in the repository.
Skill for the provider-agnostic AI runtime in CrestApps.Core 2.0. Covers AddCoreAIServices and AddAISuite registration, provider connections and configured deployments under CrestApps AI Connections and Deployments, declaring deployment Features instead of the removed Purpose or Type, resolving deployments through slots with IAIDeploymentManager ResolveSlotAsync, GetAllBySlotAsync, ResolveUtilityOrDefaultAsync and ResolveSlotOrThrowAsync, DefaultAIDeploymentSettings site defaults, IAIClientFactory chat, embedding, image, speech and realtime clients, IAICompletionService and IAICompletionContextBuilder, custom IAICompletionClient providers, and upgrading 1.x code that used AIDeploymentPurpose. Use it when wiring AI services into an ASP.NET Core host, picking a deployment in code, or troubleshooting deployments that do not resolve.
Install
npx vskill@latest install crestapps/crestapps.agentskills/crestapps-core-ai-runtimeSKILL.md
The same SKILL.md was published earlier as crestapps/crestapps.agentskills/crestapps-core-ai-runtime.
CrestApps.Core AI Runtime
The runtime is the provider-agnostic layer every other AI feature builds on. A connection holds credentials and an endpoint, a deployment names a model on a connection and declares what that model can do, and a slot says what the installation uses a deployment for.
Guidelines
- Prefer
AddCrestAppsCore(...).AddAISuite(...)for application composition. UseAddCoreAIServices()only when the host composes raw service registrations itself. - Program against
IAIClientFactory,IAICompletionService,IAICompletionContextBuilderandIAIDeploymentManager. Never create a provider SDK client in business code. - Every configured deployment declares its model capabilities through
Features. A configured entry with no features and no legacy purpose is skipped at startup with the warning "declares no model capabilities". - Pick deployments through slots (
AIDeploymentSlotNames) andResolveSlotAsync(...). There is no deployment purpose or type in 2.0. - Use
crestapps-core-ai-model-capabilitiesfor registering features, parameters and slots,crestapps-core-ai-usage-meteringfor usage records,crestapps-core-observabilityfor traces and metrics, and the provider skills (crestapps-core-openai,crestapps-core-azure-openai,crestapps-core-ollama,crestapps-core-azure-ai-inference) for provider-specific settings.
Registration
AddAISuite(...) calls AddCoreServices(), AddCoreAIServices() and AddCoreAIOrchestration(). Without the builder:
AddCoreAIServices() also chains AddCoreAITemplating() and AddCoreAIDeploymentCapabilities() (features, parameters and slots). IAIDeploymentManager is registered by AddCoreAIOrchestration(), so register orchestration whenever code resolves deployments.
Connections and Deployments
FeaturesandParameterson the entry are shorthand forProperties:AIDeploymentMetadata:Featuresand...:Parameters. Both forms work and merge.- Configured deployments are read-only in admin UIs; stored deployments come from the YesSql or EntityCore stores and are merged with configuration through
IAIDeploymentStore. - A connection name that differs from another only by case is a duplicate. The first definition wins and the second is logged as a warning.
Resolving a Deployment
Slot (AIDeploymentSlotNames) | Required feature | Site default (DefaultAIDeploymentSettings) | |
|---|---|---|---|
Chat | textGeneration (excludes realtime) | DefaultChatDeploymentName | |
Utility | textGeneration (excludes realtime), falls back to Chat | DefaultUtilityDeploymentName | |
Embedding | textEmbedding | DefaultEmbeddingDeploymentName | |
Image | imageOutput | DefaultImageDeploymentName | |
Vision | imageInput | DefaultVisionDeploymentName | |
SpeechToText | speechToText | DefaultSpeechToTextDeploymentName | |
TextToSpeech | textToSpeech | DefaultTextToSpeechDeploymentName | |
Realtime | realtime | DefaultRealtimeDeploymentName |
Resolution walks one chain: the explicit name, the slot's site default, the fallback slot's explicit name and default, then the first capable deployment.
DefaultAIDeploymentSettings is a plain options class. The framework does not bind it from configuration; configure it from your own section or site settings:
Key Runtime Services
| Service | Use | |
|---|---|---|
IAIClientFactory | Create IChatClient, IEmbeddingGenerator, IImageGenerator, ISpeechToTextClient, ITextToSpeechClient and IRealtimeClient for a deployment. Every overload except realtime accepts an Action<...Builder> pipeline callback, and the factory owns the final Build(serviceProvider) | |
IAICompletionService | CompleteAsync / CompleteStreamingAsync(deployment, messages, context, cancellationToken) without the orchestration loop | |
IAICompletionContextBuilder | BuildAsync(resource, configure, cancellationToken) runs the context handlers for a profile, interaction or other resource | |
IAIDeploymentManager | Slot resolution and deployment CRUD | |
IAIDeploymentCapabilityService | What a deployment's model declares | |
IAIProviderConnectionStore / IAIDeploymentStore | Merged configuration and store views |
Every client the factory creates is metered, and every chat client is wrapped in CapabilityEnforcingChatClient, which strips tools, JSON response formats and reasoning options the deployment does not declare. Chat clients stream tool calls and results (FunctionCallContent, FunctionResultContent) through FunctionInvokingChatClient, which the AG-UI chat shows as tool cards; NamedAICompletionClient passes stored tool result messages to the provider and drops results whose calls a past-messages limit cut off. CreateRealtimeClientAsync returns a metering wrapper; use GetService to reach the provider client.
Telemetry Options
The framework registers a scoped DefaultAIOptions that applies the site's GeneralAIOptions overrides. Two of its options control the Microsoft.Extensions.AI gen_ai.* telemetry; the framework's own CrestApps.Core spans and metrics do not depend on them.
EnableOpenTelemetry(off by default) addsgen_ai.*spans and metrics, under theAICompletionServicesource, to the OpenAI, Azure AI Inference and Ollama completion clients, the Azure OpenAI Responses path, the Claude orchestrator, and the embedding, image, speech and realtime clients fromIAIClientFactory. The Azure OpenAI chat-completions path uses the OpenAI SDK'sOpenAI.Experimental.EnableOpenTelemetryswitch instead.EnableSensitiveData(off by default) adds prompts, responses and tool arguments to those spans. It applies only whileEnableOpenTelemetryis on.
A site value applies only with its flag: GeneralAIOptions.OverrideEnableOpenTelemetry or OverrideEnableSensitiveData. See crestapps-core-observability.
Example Completion Service
To reuse a profile's prompts, tools, persona and model parameters, build the context from the profile instead: await completionContextBuilder.BuildAsync(profile, cancellationToken: cancellationToken).
Direct Clients
When you finish a builder yourself, call Build(serviceProvider), never Build().
Custom Providers
A provider that creates Microsoft.Extensions.AI clients implements IAIClientProvider (CanHandle(clientName) plus GetChatClientAsync, GetEmbeddingGeneratorAsync, GetRealtimeClientAsync and the other client getters for a connection), so IAIClientFactory, capability enforcement and metering apply to it with no extra code. A provider that owns the whole completion loop implements IAICompletionClient (ClientName, CompleteAsync, CompleteStreamingAsync) and registers it with AddCoreAICompletionClient<TClient>(clientName, configure). Deriving from AICompletionServiceBase gives ResolveDeploymentAsync(slotName, providerName, deploymentName) and ResolveRequestDeploymentAsync(context, providerName), which honors AICompletionContext.IsUtilityCompletion.
Troubleshooting
- `ResolveSlotAsync` returns `null`: no deployment declares the slot's required feature, or the only candidate declares the excluded
realtimefeature forChatorUtility. - A configured deployment is missing: the entry declares no
Features, itsClientNameis unknown, or one of its values could not be read (each bad entry is now skipped on its own with an error naming it). - Tools are never called: the deployment declares metadata without
toolCalling, so capability enforcement removes them and logs a warning.
Upgrading Within 2.0 Previews
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/CrestApps.AgentSkills/crestapps-core/crestapps-core-ai-runtime/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/crestapps/crestapps.agentskills/crestapps-core-ai-runtime)