For Japanese version, see IModelProvider-jp.md.
IModelProvider (Interface Specification)
1. Responsibility Boundary
IModelProvider is the intelligence execution-engine boundary that consumes normalized messages and performs concrete model inference.
- Role:
- Non-role:
Provide full generation, streaming generation, and direct Q&A while abstracting provider-specific transport differences.
Model selection belongs to IModelVectorRouter; provider lifecycle ownership remains in IProvider.
2. Contract Signature
namespace AIKernel.Abstractions.Providers;\n\npublic interface IModelProvider : IProvider\n{\n Task<string> GenerateAsync(IReadOnlyList<IModelMessage> messages, CancellationToken cancellationToken = default);\n Task StreamGenerateAsync(IReadOnlyList<IModelMessage> messages, Func<string, Task> onChunk, CancellationToken cancellationToken = default);\n Task<string> AnswerAsync(string question, string? context = null, CancellationToken cancellationToken = default);\n}
3. Related Use Cases
UC-02Structure phase execution:UC-04Generation and output polishing:
Serves as the execution body beneath reasoning construction.
Produces source outputs for downstream polishing/rendering.
4. Governance & Determinism
- Determinism contribution:
- Fail-Closed:
- Isolation compliance:
Implementations should maximize replay stability through fixed inference settings where possible.
Safety violations, token-limit breaches, or execution faults should fail explicitly instead of returning partial answers.
Do not inject implicit context beyond supplied messages.
5. Implementation Notes
- Transport abstraction:
- Extensibility:
Hide REST/gRPC/local runtime differences behind this contract.
Evolve multimodal support in sync with IModelMessage contract extensions.
Changelog
- v0.0.0 / v0.0.0.0: Initial draft
- v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
architecture/interfaces/provider/IModelProvider.md