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 pip:

pip install catsu

Or with uv (recommended):

uv 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.

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.1.tar.gz (38.8 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.1-py3-none-any.whl (50.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: catsu-0.0.1.tar.gz
  • Upload date:
  • Size: 38.8 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.1.tar.gz
Algorithm Hash digest
SHA256 79fd0659c6bb2f8efdf12989cde485da790ee7e90dee623de819497747df0982
MD5 e2f7224964f4102d5e3d82974a45db28
BLAKE2b-256 4e8a85c33f3148b38570ccab2faaad4c368806653accd7f320ea77b2192ab5d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catsu-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 50.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00ea04362d08419751c0a83664d71016df93f2fd41246ff0703ed4ea14c86d38
MD5 3d69ab3a6a14482f0789fc8dd22ff293
BLAKE2b-256 c7df73a71713e879d20d9572c2dd16390a7ebd4e856a38553cad4bd4132d8bc6

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