Skip to main content

🐱 The embedding client that always lands on its feet 🚀

Project description

Catsu Logo

🌐 catsu 🐱

PyPI version Python License Documentation Stars

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

The world of embedding API clients is broken.

  • Everyone defaults to OpenAI's client for embeddings, even though it wasn't designed for that purpose
  • Provider-specific libraries (VoyageAI, Cohere, etc.) are inconsistent, poorly maintained, or outright broken
  • Universal clients like LiteLLM and any-llm-sdk don't focus on embeddings at all—they rely on native client libraries, inheriting all their problems
  • Every provider has different capabilities—some support dimension changes, others don't—with no standardized way to discover what's available
  • Most clients lack basic features like retry logic, proper error handling, and usage tracking
  • There's no single source of truth for model metadata, pricing, or capabilities

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

catsu-0.0.2.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

catsu-0.0.2-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

Details for the file catsu-0.0.2.tar.gz.

File metadata

  • Download URL: catsu-0.0.2.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for catsu-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e4a27a4e41b5c240cdad84f899020d98bcf9717fb9573b99a8812e320b6945b2
MD5 a6785e62141746ec813ea27d06e98965
BLAKE2b-256 a9769b58d6966b0e030c07fc0140a9ec4521248dd9a0cc7fd40b00bd62e2e444

See more details on using hashes here.

File details

Details for the file catsu-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: catsu-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for catsu-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8e0933f352145546923fbe06d027920df43fb7e51ba9768a14e0bff0e5b68310
MD5 8b0cd52ee65dfa9ad93c3e3197cb7bfc
BLAKE2b-256 df610b5f7a49131e753869871213c2d700f6d7d0222d3b6d2bf81b6677aae7d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page