ADR-0061 — llama.cpp is an AEP provider and capabilities are resolved effectively
Status
Accepted
Context
Ollama already runs behind an autonomous AEP extension, but some startup aliases, UI copy, and compatibility validation still mentioned Ollama in generic layers. AEP provider and model descriptors advertised capabilities without carrying them into Runtime execution, so the existing provider/model/runtime/adapter intersection was exercised only by unit tests. Adding llama.cpp must not recreate an in-process provider hierarchy or claim features that the selected server and model cannot execute.
Decision
Agentstration.Extensions.LlamaCppis an autonomous AEP model-provider extension. Agentstration persists the extension endpoint;LlamaCpp:Endpointconfigures the extension's nativellama-serverendpoint.- The extension uses llama.cpp's OpenAI-compatible
/v1/chat/completionsand/v1/modelsroutes plus native/healthand/propsinspection. It does not expose native/completionas chat. - Model capabilities are observed dynamically. Tool calling and reasoning are advertised for a selected model only when
/propsexposes matching chat-template capabilities. Structured output and streaming are native server capabilities. Current AEP image transport is not effective, so the extension does not advertise provider-level vision support. IModelProviderCapabilitiesResolverresolves provider, selected-model, and concrete adapter capabilities with the client.ModelChatClientMetadatacarries those levels to Runtime.- Microsoft Agent Framework intersects provider, model, AEP-to-
IChatClient, and runtime capabilities before invocation. Requested streaming, tools, structured output, or reasoning that is effectively unsupported fails before the provider call. - Provider-native validation remains in its extension. The Ollama
endpointMode=generaterule is removed from the generic compatibility validator. AI:Provider=Managedis the single persisted-profile mode. Generic composition does not branch on concrete provider identifiers.- Aspire orchestrates the llama.cpp AEP extension but only connects to an existing
llama-server. It does not provision llama.cpp, Docker, or GGUF models.
Consequences
Ollama and llama.cpp are independent implementations of AEP's functional provider contract, while MAF remains unaware of both. Resolution performs dynamic discovery before execution, adding local HTTP calls but preventing stale or invented capability claims. A future OpenAI-compatible extension may extract the common Chat Completions transport after another backend demonstrates the same requirements; llama.cpp-specific health, properties, and native options remain explicit for now.