Skip to content

chonkie-inc/catsu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

121 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Catsu Logo

🌐 catsu 🐱

Crates.io PyPI version License Documentation Discord

A unified, batteries-included client for embedding APIs that actually works.

Rust β€’ Python

The world of embedding API clients is broken. (details)

Catsu fixes this. It's a high-performance, unified client built specifically for embeddings with:

🎯 A clean, consistent API across all providers
πŸ”„ Built-in retry logic with exponential backoff
πŸ’° Automatic usage and cost tracking
πŸ“š Rich model metadata and capability discovery
⚑ Rust core with Python bindings for maximum performance

πŸ“¦ Rust

Add to your Cargo.toml:

[dependencies]
catsu = "0.1"
tokio = { version = "1", features = ["full"] }

Quick Start

use catsu::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create client (reads API keys from environment)
    let client = Client::new()?;

    // Generate embeddings
    let response = client.embed(
        "openai:text-embedding-3-small",
        vec!["Hello, world!".to_string(), "How are you?".to_string()],
    ).await?;

    println!("Dimensions: {}", response.dimensions);
    println!("Tokens used: {}", response.usage.tokens);
    println!("Embedding: {:?}", &response.embeddings[0][..5]);

    Ok(())
}

With Options

use catsu::{Client, InputType};

let response = client.embed_with_options(
    "openai:text-embedding-3-small",
    vec!["Search query".to_string()],
    Some(InputType::Query),  // input type hint
    Some(256),               // output dimensions
).await?;

Model Catalog

// List all available models
let models = client.list_models(None);

// Filter by provider
let openai_models = client.list_models(Some("openai"));
for model in openai_models {
    println!("{}: {} dims", model.name, model.dimensions);
}

🐍 Python

Looking for Python? See the Python documentation.

pip install catsu
from catsu import Client

client = Client()
response = client.embed("openai:text-embedding-3-small", ["Hello, world!"])
print(f"Dimensions: {response.dimensions}")

🀝 Contributing

Can't find your favorite model or provider? Open an issue and we'll add it!

For guidelines on contributing, see CONTRIBUTING.md.


If you found this helpful, consider giving it a ⭐!

made with ❀️ by chonkie, inc.

About

πŸ”Œ Want one client library for all your embeddings? πŸ’™ Choose Catsu! 🐱

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors