High-performance embeddings client for multiple providers
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file catsu-0.1.7.tar.gz.
File metadata
- Download URL: catsu-0.1.7.tar.gz
- Upload date:
- Size: 48.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91eb099f4d24b50e90e77853849bfcc52a7388d2711caaae83eb8324af0e0aca
|
|
| MD5 |
d8cc1ad696dbe48bff99a0346cf0eed8
|
|
| BLAKE2b-256 |
d7fa8411b58f332b804df8ae4816d283e1fa527254e4c7f46616e3ee389c464e
|
File details
Details for the file catsu-0.1.7-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: catsu-0.1.7-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72435ca93ca81fc3e2695f3fdf6c57f9375e3f94516b34488e265a7174d75ab0
|
|
| MD5 |
01eebbeaa867fba398dd7881af325560
|
|
| BLAKE2b-256 |
176a963f5075a079e7ba724315669af8734cb6f834540e1d2ca3de5e27117fcd
|
File details
Details for the file catsu-0.1.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a67f74e693df10ca834fe683a67dc7600e87729566e67ee6ae71ba31aaecf7e
|
|
| MD5 |
a99ced43ca490637edf823f38f68d535
|
|
| BLAKE2b-256 |
c7691783c9900977b353826f5faa7075374b5a33f4423bc1aac5d87a4418eb18
|
File details
Details for the file catsu-0.1.7-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: catsu-0.1.7-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f807eb14e2312c39a04680b52a13465dc3ed7b63b71b827cc1953f8a831b210
|
|
| MD5 |
0f22a04dcdfa91558ae0063d4c898f37
|
|
| BLAKE2b-256 |
ec42f5cf500d929ccb67a7bc1bb1326c862ad2ed275e04503aad069fe7b09c4a
|
File details
Details for the file catsu-0.1.7-cp313-cp313-macosx_10_12_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp313-cp313-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.13, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47574903be0a46fc81f9133cdedff486cb1cab03b635b70e1bd09bd84e1e14f7
|
|
| MD5 |
837dc9fc6c4e6b40c16a70c8a006dce5
|
|
| BLAKE2b-256 |
6ba2a72e7e5418546d48e322f2e616a1842854b87993b2f3784e6e56692fec95
|
File details
Details for the file catsu-0.1.7-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: catsu-0.1.7-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
463d55a7c3a8499333671b6b8ad9e4dc2539e8fafd440e4a014b3921a2737403
|
|
| MD5 |
9f19b10ac5bee1f83c240a3f7ecbe986
|
|
| BLAKE2b-256 |
be87f34ca5615c9cf05f3438c4293d35bff6aaf5acd4e327626038147240a056
|
File details
Details for the file catsu-0.1.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8df14d8b9392535bc4beaf2a4118717487e5085336cc0e78108f32628a6fab1f
|
|
| MD5 |
4197a1dfccdc65ee3eed9db6224151a2
|
|
| BLAKE2b-256 |
aa345a56359c3bd9f2e04521f08949dbcd7ce5c1a2fe22f901658acf76367e50
|
File details
Details for the file catsu-0.1.7-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: catsu-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dee4b11507a17cae39c8eedbf1a5d7a91e1f515b1bd91e8f28db26412b5dd649
|
|
| MD5 |
195c7887f6e54b9f8d066144a568cb56
|
|
| BLAKE2b-256 |
ef499374d2688ce2f1510414e8e3287fffc49b73327eb8cae84849f32aa89b15
|
File details
Details for the file catsu-0.1.7-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d73ca0772706d508c21d82886bd24603ab7ef035befe93f7cd636357542c446
|
|
| MD5 |
141d3206d8409c28ca6f583126c63b84
|
|
| BLAKE2b-256 |
f315b8d32b6360d6eac0f58a1aade46c64d68a0052beba7f4feaadfbe15ec4cb
|
File details
Details for the file catsu-0.1.7-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: catsu-0.1.7-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9276e1c32cc18f4bf4890b38db97df76a4ff068161fbd7dbc823b2c08cedc022
|
|
| MD5 |
eae71d8b58fa313f0771771446bd2648
|
|
| BLAKE2b-256 |
2b536b611618616d2a5330689053be29377472948df11c9f5431892ff4da7281
|
File details
Details for the file catsu-0.1.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc151049819027c4df28701458f3e56d8507c0148c90e0383c75c9b2e7229f6c
|
|
| MD5 |
98c8d72f436ebd985a1463b6a77a3511
|
|
| BLAKE2b-256 |
342b1bf750aab2957a27b18339aa567fb3086ce232a6dd057981d26e03ede68e
|
File details
Details for the file catsu-0.1.7-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: catsu-0.1.7-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5956c324b9ef6685ca6814e83cd1997bec550503e848ef168956dcc2d78b5a97
|
|
| MD5 |
6e5f0d9710e8b5014100089edb4fff0f
|
|
| BLAKE2b-256 |
efaa4bf72a94f27533478d854a63f06122720a85b35c20434088f2c7f26df57c
|
File details
Details for the file catsu-0.1.7-cp311-cp311-macosx_10_12_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp311-cp311-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.11, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e43290417b64b80b389419b765500a1e5dcef584bd5b77185efbf513b6c255ea
|
|
| MD5 |
db3e06dcec3a598b988e27a15cfc65e6
|
|
| BLAKE2b-256 |
df85511457b28cb3193ee0a98fa5ef45f35268dde9ea114045e25c38f03fd172
|
File details
Details for the file catsu-0.1.7-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: catsu-0.1.7-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d08e6657fc9b7db03319f91b157eaaac4f23df4eb6fbff4f998687b10ec3aa3
|
|
| MD5 |
6989d35cbc4d3471971750d0b78c6f34
|
|
| BLAKE2b-256 |
a38daae9e4da51d078d828288d48a339ae7345a250f00b368827e6223499317c
|
File details
Details for the file catsu-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffffcad9409577f79ee058b5da7d33e231de3aed015f4f2917785f7b430aa1a5
|
|
| MD5 |
745153eb3fd611b21ef3ff1340db682f
|
|
| BLAKE2b-256 |
b05059b89fd01299d18a934c9e2e86b462e77446caca8563708f85ff567f8296
|
File details
Details for the file catsu-0.1.7-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: catsu-0.1.7-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb43eccbc28fba26123273d78f020d68c261d84d1a08e7413139df4fb5e68afe
|
|
| MD5 |
c87914b3506c842b35af16366d12f9a3
|
|
| BLAKE2b-256 |
d38ac77dfe164dd9304c39bc29d5869154299d3a39082767a2a7fe57e74011f3
|
File details
Details for the file catsu-0.1.7-cp310-cp310-macosx_10_12_x86_64.whl.
File metadata
- Download URL: catsu-0.1.7-cp310-cp310-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.10, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41a733d93bf828d90a28800e26b81f8a4afb4bd1ed28570a3a7649ed2f4e85d7
|
|
| MD5 |
67530243014c5fb2b051572b5f128292
|
|
| BLAKE2b-256 |
2b4b9dfc944860a92d1d9479f36b4a68a10a968d4f797db2ad1e083f82090562
|