High-performance embeddings client for multiple providers
Project Links
Meta
Author: Bhavnick Minhas
Requires Python: >=3.11
Classifiers
Development Status
- 3 - Alpha
Intended Audience
- Developers
License
- OSI Approved :: Apache Software License
Programming Language
- Rust
- Python :: Implementation :: CPython
- Python :: 3
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
Topic
- Scientific/Engineering :: Artificial Intelligence
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 don't focus on embeddings—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
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
Installation
pip install catsu
Quick Start
from catsu import Client
# Create client (reads API keys from environment)
client = Client()
# Generate embeddings
response = client.embed(
"openai:text-embedding-3-small",
["Hello, world!", "How are you?"]
)
print(f"Dimensions: {response.dimensions}")
print(f"Tokens used: {response.usage.tokens}")
print(f"Embedding: {response.embeddings[0][:5]}")
Async Support
import asyncio
from catsu import Client
async def main():
client = Client()
response = await client.aembed(
"openai:text-embedding-3-small",
"Hello, async world!"
)
print(response.embeddings[0][:5])
asyncio.run(main())
With Options
response = client.embed(
"openai:text-embedding-3-small",
["Search query"],
input_type="query", # "query" or "document"
dimensions=256, # output dimensions (if supported)
)
Model Catalog
# List all available models
models = client.list_models()
# Filter by provider
openai_models = client.list_models("openai")
for m in openai_models:
print(f"{m.name}: {m.dimensions} dims, ${m.cost_per_million_tokens}/M tokens")
Configuration
client = Client(
max_retries=5, # Default: 3
timeout=60, # Default: 30 seconds
)
NumPy Integration
# Convert embeddings to numpy array
arr = response.to_numpy()
print(arr.shape) # (2, 1536)
Context Manager
# Sync
with Client() as client:
response = client.embed("openai:text-embedding-3-small", "Hello!")
# Async
async with Client() as client:
response = await client.aembed("openai:text-embedding-3-small", "Hello!")
If you found this helpful, consider giving it a ⭐!
made with ❤️ by chonkie, inc.
0.1.8
Feb 20, 2026
0.1.7
Jan 16, 2026
0.1.6
Jan 12, 2026
0.1.5
Jan 07, 2026
0.1.4
Jan 07, 2026
0.0.2
Dec 14, 2025
0.0.1
Dec 11, 2025
0.0.1a2
Dec 10, 2025
0.0.1a1
Dec 09, 2025
0.0.1a0
Dec 09, 2025
Wheel compatibility matrix
| Platform | CPython 3.10 | CPython 3.11 | CPython 3.12 | CPython 3.13 |
|---|---|---|---|---|
| macosx_10_12_x86_64 | ||||
| macosx_11_0_arm64 | ||||
| manylinux2014_x86_64 | ||||
| manylinux_2_17_x86_64 | ||||
| win_amd64 |
Files in release
catsu-0.1.8-cp310-cp310-macosx_10_12_x86_64.whl (2.1MiB)
catsu-0.1.8-cp310-cp310-macosx_11_0_arm64.whl (2.1MiB)
catsu-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3MiB)
catsu-0.1.8-cp310-cp310-win_amd64.whl (1.9MiB)
catsu-0.1.8-cp311-cp311-macosx_10_12_x86_64.whl (2.1MiB)
catsu-0.1.8-cp311-cp311-macosx_11_0_arm64.whl (2.1MiB)
catsu-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3MiB)
catsu-0.1.8-cp311-cp311-win_amd64.whl (1.9MiB)
catsu-0.1.8-cp312-cp312-macosx_10_12_x86_64.whl (2.1MiB)
catsu-0.1.8-cp312-cp312-macosx_11_0_arm64.whl (2.0MiB)
catsu-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3MiB)
catsu-0.1.8-cp312-cp312-win_amd64.whl (1.9MiB)
catsu-0.1.8-cp313-cp313-macosx_10_12_x86_64.whl (2.1MiB)
catsu-0.1.8-cp313-cp313-macosx_11_0_arm64.whl (2.0MiB)
catsu-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3MiB)
catsu-0.1.8-cp313-cp313-win_amd64.whl (1.9MiB)
catsu-0.1.8.tar.gz (48.8KiB)
No dependencies
