32 releases
| new 0.1.17 | Mar 5, 2026 |
|---|---|
| 0.1.16 | Mar 4, 2026 |
| 0.1.13 | Feb 11, 2026 |
| 0.0.14 | Jan 27, 2026 |
#2448 in Development tools
196 downloads per month
Used in 28 crates
(11 directly)
165KB
5.5K
SLoC
systemprompt-provider-contracts
Provider trait contracts for systemprompt.io - LLM, Tool, Job, Template, Component providers.
Overview
Defines the core provider trait contracts used throughout systemprompt.io. These traits establish the interface boundaries for LLM providers, tool executors, job runners, template providers, and component renderers. Implementations live in domain crates while contracts remain in the shared layer for maximum composability.
Part of the Shared layer in the systemprompt.io architecture.
Installation
Add to your Cargo.toml:
[dependencies]
systemprompt-provider-contracts = "0.0.1"
Quick Example
use systemprompt_provider_contracts::{
LlmProvider, ChatRequest, ChatResponse, LlmProviderResult,
ToolProvider, ToolDefinition, ToolCallRequest, ToolCallResult,
};
use async_trait::async_trait;
struct MyLlmProvider;
#[async_trait]
impl LlmProvider for MyLlmProvider {
async fn chat(&self, request: ChatRequest) -> LlmProviderResult<ChatResponse> {
// Implementation
todo!()
}
}
Core Types
| Type | Description |
|---|---|
LlmProvider |
Trait for LLM chat completions |
ToolProvider |
Trait for tool discovery and execution |
Job |
Trait for background job execution |
TemplateProvider |
Trait for template loading |
ComponentRenderer |
Trait for component rendering |
PageDataProvider |
Trait for page data injection |
TemplateDataExtender |
Trait for extending template context |
Dependencies
Internal
| Crate | Purpose |
|---|---|
systemprompt-identifiers |
Typed identifiers |
External
| Crate | Purpose |
|---|---|
async-trait |
Async trait support |
inventory |
Compile-time registration |
serde |
Serialization |
License
FSL-1.1-ALv2 - See LICENSE for details.
Dependencies
~4–5.5MB
~108K SLoC