Skip to content

chonkie-inc/catsu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Catsu Logo

🌐 catsu 🐱

PyPI version PyPI Downloads codecov Python License Documentation Discord Stars

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

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

Catsu fixes this. It's a lightweight, 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
⚠️ Proper error handling and type hints
⚑ First-class support for both sync and async

πŸ“¦ Install

Install with uv (recommended):

uv pip install catsu

Or with pip:

pip install catsu

πŸš€ Quick Start

Get started in seconds! Just import catsu, create a client, and start embedding:

import catsu

# Initialize the client
client = catsu.Client()

# Generate embeddings (auto-detects provider from model name)
response = client.embed(
    model="voyage-3",
    input="Hello, embeddings!"
)

# Access your results
print(f"Dimensions: {response.dimensions}")
print(f"Tokens used: {response.usage.tokens}")
print(f"Cost: ${response.usage.cost:.6f}")
print(f"Embedding: {response.embeddings[0][:5]}...")  # First 5 dims

That's it! No configuration neededβ€”catsu picks up your API keys from environment variables automatically (VOYAGE_API_KEY, OPENAI_API_KEY, etc.).

Want more control? Specify the provider explicitly:

# Method 1: Separate parameters
response = client.embed(provider="voyageai", model="voyage-3", input="Hello!")

# Method 2: Provider prefix
response = client.embed(model="voyageai:voyage-3", input="Hello!")

Need async? Just use aembed:

response = await client.aembed(model="voyage-3", input="Hello, async world!")

πŸ“– Want to learn more? Check out the complete documentation for detailed guides on all providers, parameters, and best practices.

🀝 Contributing

Can't find your favorite model or provider? Open an issue and we will promptly try to add it! We're constantly expanding support for new embedding providers and models.

For guidelines on contributing, please 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

No packages published