#abstraction #llm-provider #http-client #traits #message #type-safe

cognate-core

Core traits, types, and HTTP client abstractions for the Cognate LLM framework

1 unstable release

0.1.0 Apr 8, 2026

#176 in #abstraction


Used in 7 crates

MIT/Apache

35KB
588 lines

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 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(())
}

Dependencies

~10–19MB
~261K SLoC