Cognate Core — HTTP client, traits, and base types for LLM providers.
This crate provides the foundational abstractions for building provider-agnostic LLM applications with type-safe interfaces and zero-cost abstractions.
Quick start
use ;
async
Cognate Core — HTTP client, traits, and base types for LLM providers.
This crate provides the foundational abstractions for building provider-agnostic LLM applications with type-safe interfaces and zero-cost abstractions.
use cognate_core::{Provider, Request, Message};
async fn run<P: Provider>(provider: &P) -> cognate_core::Result<()> {
let response = provider
.complete(
Request::new()
.with_model("gpt-4o-mini")
.with_message(Message::user("Hello!")),
)
.await?;
println!("{}", response.content());
Ok(())
}