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!")

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: catsu-0.0.1a2.tar.gz
  • Upload date:
  • Size: 34.3 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.1a2.tar.gz
Algorithm Hash digest
SHA256 df329a3e76301d4b32647261172c175f127dd4ce3b2b15007b1fbbc7c31ea431
MD5 68c3b75347bf8e7c5ed3004ee37ebb92
BLAKE2b-256 c01b6d4a382f7026a6f925b3af0a3eaefa8feeb1bda741a462bc882edddaeac9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catsu-0.0.1a2-py3-none-any.whl
  • Upload date:
  • Size: 40.7 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.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 809ebd1be470ce7d83a46faabb1a79dd5be7fde514d892183a81c3af2cb34388
MD5 b4ea7a69701f77e7953fbaf9819c104b
BLAKE2b-256 4030fc941e57bc1b9afdb0299deb11c405fc9957dc4913210854bc9698b14f71

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