Skip to content

Introduce metadata-driven AI model features and parameters - #122

Open
MikeAlhayek wants to merge 8 commits into
mainfrom
ma/deployment-features
Open

Introduce metadata-driven AI model features and parameters#122
MikeAlhayek wants to merge 8 commits into
mainfrom
ma/deployment-features

Conversation

@MikeAlhayek

Copy link
Copy Markdown
Member

Fix #120

Replaces hardcoded, provider-specific model options with an extensible registry of model features (binary capabilities) and model parameters (configurable options carrying kind, allowed values, ranges, and defaults).

AI deployments declare which registered definitions their model exposes and may narrow the allowed values, default, or numeric bounds. AI profiles, profile templates, and chat interactions store the selected values, and the runtime binds them into the outgoing request. Values for parameters a deployment does not expose are never rendered and never sent.

Framework:

  • adds the capability abstractions, descriptors, and metadata models
  • adds AddCoreAIModelCapabilities, AddAIModelFeature, and AddAIModelParameter
  • registers eight built-in features and the reasoningEffort parameter
  • adds DefaultAIModelCapabilityService to merge registrations with deployment metadata without mutating the registered descriptors
  • adds ModelParametersAICompletionServiceHandler as the single enforcement point, with deployment-default fallback and binder dispatch
  • adds IAIModelParameterBinder and a reasoning effort binder that sets ChatOptions.Reasoning.Effort
  • maps the resolved effort onto ChatCompletionOptions.ReasoningEffortLevel in AzureOpenAICompletionClient so both request paths behave the same
  • adds CompletionServiceConfigureContext.Deployment
  • adds a ModelParameters front-matter key to the markdown template parser

Sample hosts:

  • adds a deployment capability editor and a metadata-driven parameter editor to the AI deployment, profile, template, and chat interaction screens in CrestApps.Core.Mvc.Web
  • adds the equivalent ModelCapabilitiesEditor and ModelParametersEditor components to CrestApps.Core.Blazor.Web

Docs:

  • adds the Model Capabilities guide and records the change in the 1.1.0 changelog

Replaces hardcoded, provider-specific model options with an extensible
registry of model features (binary capabilities) and model parameters
(configurable options carrying kind, allowed values, ranges, and defaults).

AI deployments declare which registered definitions their model exposes and
may narrow the allowed values, default, or numeric bounds. AI profiles,
profile templates, and chat interactions store the selected values, and the
runtime binds them into the outgoing request. Values for parameters a
deployment does not expose are never rendered and never sent.

Framework:
- adds the capability abstractions, descriptors, and metadata models
- adds AddCoreAIModelCapabilities, AddAIModelFeature, and AddAIModelParameter
- registers eight built-in features and the reasoningEffort parameter
- adds DefaultAIModelCapabilityService to merge registrations with deployment
  metadata without mutating the registered descriptors
- adds ModelParametersAICompletionServiceHandler as the single enforcement
  point, with deployment-default fallback and binder dispatch
- adds IAIModelParameterBinder and a reasoning effort binder that sets
  ChatOptions.Reasoning.Effort
- maps the resolved effort onto ChatCompletionOptions.ReasoningEffortLevel in
  AzureOpenAICompletionClient so both request paths behave the same
- adds CompletionServiceConfigureContext.Deployment
- adds a ModelParameters front-matter key to the markdown template parser

Sample hosts:
- adds a deployment capability editor and a metadata-driven parameter editor
  to the AI deployment, profile, template, and chat interaction screens in
  CrestApps.Core.Mvc.Web
- adds the equivalent ModelCapabilitiesEditor and ModelParametersEditor
  components to CrestApps.Core.Blazor.Web

Docs:
- adds the Model Capabilities guide and records the change in the 1.1.0
  changelog

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve those before requesting a review.

MikeAlhayek and others added 6 commits August 8, 2026 01:20
- List only genuine trained model capabilities under "Trained features"
  (add image/audio/video input/output; drop provider-hosted web search)
- Add AIModelFeatureDescriptor.EnabledByDefault; default toolCalling + streaming on
- Add ModelFeaturesAICompletionServiceHandler to enforce features at runtime,
  stripping tools/ToolMode and JSON response format when not declared (opt-in on metadata)
- MVC + Blazor: "Trained features" heading, default-on features, read-only
  capability badges in profile/template/chat editors
- MVC: bootstrap-select searchable multi-select on deployment allowed-values pickers
- Update docs and 1.1.0 changelog; add enforcement + registration tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove form-select class from the deployment allowed-values multiselect so
  the native control no longer shows nested inside the bootstrap-select picker
- Upgrade @crestapps/bootstrap-select CDN assets from 1.2.0 to 1.2.1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add AIModelParameterDescriptor.RequiredFeature so a parameter can declare a
  dependency on a trained feature; wire the built-in reasoningEffort parameter
  to require the reasoning feature
- MVC and Blazor deployment editors only show a dependent parameter while its
  feature is enabled, and clear/disable it when the feature is turned off so a
  contradictory config (e.g. reasoningEffort on a non-reasoning model) can't be saved
- Update docs and 1.1.0 changelog; add RequiredFeature registration and Clone tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n framework

- Deployment editors now render a parameter that declares a RequiredFeature
  inline beneath its feature checkbox; the "Model parameters" heading only
  appears for parameters not linked to a feature
- Extract the MVC parameter card into a _DeploymentModelParameterCard partial and
  the Blazor card into a shared RenderFragment to reuse in both locations
- Enforce the parameter/feature relationship in the framework:
  DefaultAIModelCapabilityService.GetCapabilities now excludes a parameter whose
  RequiredFeature is not declared by the deployment, so the runtime handlers never
  apply it regardless of how the metadata was authored
- Add framework tests for the new capability filtering; update docs and changelog

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add extensible model capability enforcement so unsupported request
options never reach a provider, avoiding provider validation errors
(e.g. HTTP 400).

Framework:
- Add shared ModelFeatureEnforcement helper that strips tools/ToolMode
  when toolCalling is not declared, removes a JSON response format when
  structuredOutputs is not declared, removes reasoning options when
  reasoning is not declared, removes the reasoning effort when the
  reasoningEffort parameter is not exposed, and coerces an unsupported
  effort to the deployment default (preserving other reasoning state).
- Add CapabilityEnforcingChatClient and wire it into DefaultAIClientFactory
  as the terminal layer above the provider client so enforcement also runs
  for callers that resolve an IChatClient directly. Enforcement is opt-in
  to deployments that declare capability metadata; the capability service
  is optional so unconfigured hosts are unchanged.
- Convert model parameter values written to AdditionalProperties to their
  typed primitive; parse integers through decimal for exact Int64 bounds,
  reject non-finite numbers, and skip values that cannot be represented.
- Log the Azure ExtraHigh -> High reasoning-effort clamp instead of
  downgrading silently.
- Replace the computerUse feature with videoOutput.

UI:
- Unify the Blazor and MVC deployment editors on bootstrap-select (1.2.1)
  and sort trained features alphabetically.

Docs and tests updated; all tests pass with zero warnings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Complete streaming requests as a single buffered (non-streaming) response
when a deployment does not declare the streaming trained feature, replaying
the result via ToChatResponseUpdates(). Enforced on both the client-factory
path (CapabilityEnforcingChatClient) and the Azure SDK direct path
(AzureOpenAICompletionClient). The Azure non-streaming completion no longer
swallows OperationCanceledException, so a suppressed streaming fallback
propagates cancellation like a normal streaming request.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve those before requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce Metadata-Driven AI Deployment Features and Parameters

1 participant