Skip to main content

High-performance embeddings client for multiple providers

Project description

Catsu Logo

🐱 catsu

PyPI version Python License Documentation Discord

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


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.1.5.tar.gz (48.0 kB view details)

Uploaded Source

Built Distributions

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

catsu-0.1.5-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

catsu-0.1.5-cp313-cp313-manylinux_2_24_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64

catsu-0.1.5-cp313-cp313-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

catsu-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

catsu-0.1.5-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

catsu-0.1.5-cp312-cp312-manylinux_2_24_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64

catsu-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

catsu-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

catsu-0.1.5-cp311-cp311-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.11Windows x86-64

catsu-0.1.5-cp311-cp311-manylinux_2_24_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64

catsu-0.1.5-cp311-cp311-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

catsu-0.1.5-cp311-cp311-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

catsu-0.1.5-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

catsu-0.1.5-cp310-cp310-manylinux_2_24_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64

catsu-0.1.5-cp310-cp310-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

catsu-0.1.5-cp310-cp310-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for catsu-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ac0bb747508b788611a87a483fa54f812cc47b3183734c9fb416babe62d38bfb
MD5 8c2c69d566ae9b4922283255ae7aeda9
BLAKE2b-256 43fe4c37c7531ff67d050f88964bf1aa989ac227b0943dc5ee7787d0e78e827b

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: catsu-0.1.5-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

Hashes for catsu-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ec4e9c63997e14260b526afb9105364d7aec85da70231cb7d87a65dbca8db793
MD5 d0673640798af11554de69fb32c1c4a8
BLAKE2b-256 968bb7f12cfb32e2e6de3540f73c2f926cd24539547b9e67ab27c1e22bed4962

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp313-cp313-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp313-cp313-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 acf2b6755d842694266a524cc65eb110bbb5e33337982da9abe33b103ac1995b
MD5 3173934beea55bdb540251993fe04448
BLAKE2b-256 aad84dffc0ababf89b0951c2b7f081ba67a6667d0c6d1d030862010197862320

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca7f9575d9a495508ee6935242138087f18aa57433212311971d64f60cce2ee3
MD5 191ab7be8c2d04568cc4271c41dbb083
BLAKE2b-256 9e5dc5c6e2cc3464a121891247b25e063f81d25e0eb5d5175bb17e1f198e8816

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e42bc26f270f7151446db6a8e5ebea9e4ac5114fbe24801fdd5f68c735225a0f
MD5 e2a3cf3291a70053f41cf902b68ea77e
BLAKE2b-256 ac03e7f1adafac47602e1c093ef219f79a4ec04de27f43a16de410f7db5b81dd

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: catsu-0.1.5-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

Hashes for catsu-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4a99e3f6ed9d7adb5264d54312bd2de97e50435b861fcdbb18611c4f1d4f802c
MD5 e0a8c3d74ecd7d288b72b99f253ae6b0
BLAKE2b-256 e527f640749f4ca68eeee96b93c5a6d8005dc2234b024b52d90624749b011110

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp312-cp312-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp312-cp312-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 abcbb05485e184d7cd9506aa2445f119b89ad4fbe0698012893da956a0482405
MD5 198fb5a23142ec0ab5458b9a9343a096
BLAKE2b-256 30b1da0125cb23efdd28ad35ae4c80bae38656f7d1080de94ce5b28837e0a072

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9cd5172212730ff99e9015e2c8a8d0df7e5fcfadd9fe6359b81e380d224629b3
MD5 01a154d39846143b39b982c0bb6c8c8e
BLAKE2b-256 ea2d0d276a25c1ca9c9c6be09fad367d12f17e170e0f272455d963ed4778a207

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b0042f353342194af07077a45f1fe76eaecec7842d997534104389b84d553bd0
MD5 1ff8c83d1b33bc2762e507734816d339
BLAKE2b-256 6facf3e7aa199f808d61fdf4ce5e4eb0ed67c93ec83b43678d1c68e5ae258367

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: catsu-0.1.5-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

Hashes for catsu-0.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7d3fb64dd7a5c10e2e2b08f558b38a9fd8f97f9fbba434408e746c42ef63a45c
MD5 c091d97c4cc0a295b00ddb617b505fdc
BLAKE2b-256 3dd15c488eade33d759f2b127c565015f854fb898fa4646cfe4dc3b7ada48c8e

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp311-cp311-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp311-cp311-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 0a0f55e0777e28957038b2d1da41321e060ad16fec4670a537ad70b08bada7a4
MD5 cf0f75ded5dd130abfbfa52844e8d9b4
BLAKE2b-256 ef366d4a71db1fedc6e6a7a304d9a8eb233f80c529a58716ce7b2f21cad467bc

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b846de259179e929e1379f2203aca67494bb3f1338bdeda78143ac71784ba431
MD5 4fe4301a83c87af450e60d53c3abd08d
BLAKE2b-256 d90927ab2acb3caab9a6a0f04b781c83b9db955605133de5d2e091b104a94351

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aedbc95c73d2d1faa278a0d9ba78aa9fa1f07fb74c70081845a51c5c3c6dc266
MD5 3c637266f7cba87a3bc53fee69a5c0b1
BLAKE2b-256 97c15be1c60b78de845e0ee6d6b0936c2f8e6ca693184fe24707beac34050488

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: catsu-0.1.5-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

Hashes for catsu-0.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 113d230b6addb4b64640e30aeb380be1bde042e28a64e0b44c609067377a4700
MD5 661309c632f4f47badde1dbf9823118b
BLAKE2b-256 e73e6f7256d7994dad88bdedc3cd5a1cf47645aeb73ad02e8cec620a81399bc0

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 2de61be944c3da043a8a44b51ac66d609c9cf5a9b608d1d4c2f80b4a2871c425
MD5 018ea233ee02089e44eb2f0f642a306a
BLAKE2b-256 68359d43cceae5056f8595679b1ec20c6ce97abda53de34e202c3d53fd98d5bf

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34aed0f8a5539d3deb08f445300735da0c0f1c5258f1840eb7b336ab38c99c97
MD5 2893429787189fda25de0a9826da9956
BLAKE2b-256 ceabe783dffea465a89f3d2e262668663adf5ab6087751ab4f5b577a6d14e33d

See more details on using hashes here.

File details

Details for the file catsu-0.1.5-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.5-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 81f325f20cbbf998bea3636fcd3082c33a400f547ff0a9e8bd3b7bbd3c941e6c
MD5 37fb7a131dfdd3556c2b0dc185d08af1
BLAKE2b-256 c82a39aa7b9a7982d80372afeb5dbfe4db7849570c1f567f486d900d6c79b0d4

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