#openai #framework #ai #llm

topkio

Not all AI agent frameworks are called topkio

6 releases

0.1.5 Jan 30, 2025
0.1.4 Jan 25, 2025

#213 in Machine learning

Download history 363/week @ 2025-01-20 143/week @ 2025-01-27 26/week @ 2025-02-03

532 downloads per month

MIT license

47KB
1K SLoC

topkio.rs

crates.io docs.rs crates.io


Not all AI agent frameworks are called topkio.

Small, fast, powerful, and easy to use.

WIP

Features

  • OpenAI
  • Ollama
  • Gemini
  • Atoma
  • streaming
  • tool
  • embeddings

Quick Start

use topkio::{AgentBuilder, OpenAIClient};

#[tokio::main]
async fn main() {
    let client = OpenAIClient::with_ollama("http://localhost:11434/v1");
    let agent = AgentBuilder::new(client, "llama3.2")
        .stream(true)
        .temperature(0.8)
        .build();

    let f = |res: &str| {
        print!("{}", res);
    };

    let prompt = "Entertain me";
    let _ = agent.prompt(prompt, f).await;

    println!("\n");
}

Dependencies

~4–16MB
~200K SLoC