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.6.tar.gz (48.2 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.6-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

catsu-0.1.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

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

Uploaded CPython 3.12Windows x86-64

catsu-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

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

Uploaded CPython 3.11Windows x86-64

catsu-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

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

Uploaded CPython 3.10Windows x86-64

catsu-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

catsu-0.1.6-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.6.tar.gz.

File metadata

  • Download URL: catsu-0.1.6.tar.gz
  • Upload date:
  • Size: 48.2 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.6.tar.gz
Algorithm Hash digest
SHA256 befa69f10a8f3959cc6444f7997f401571275ac0f4c128de7e948d2c1aa7cef5
MD5 e58ea030eb407c987c452bf429359203
BLAKE2b-256 5d7cab2d0d04f8d6231e243b6ec2ece3bc05b600b90e4fd86309c7fc1fc75cb2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catsu-0.1.6-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.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 75ae0df8c6bcc71b0595357c3d33608f6a344f638eaf3049f1a38db11b750a37
MD5 aee2d687e1637ecfd8d308e25df8c146
BLAKE2b-256 7b4d1fb2b81a36b6b0420e8b10cae91c32549c0e8559d25a6b049251d710051e

See more details on using hashes here.

File details

Details for the file catsu-0.1.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7098289a72a60f19573bea6b13153828a35b744b998200db64052b652bcac1ce
MD5 3b86f76e29819266f726c5526f1306c0
BLAKE2b-256 302a93ef017ec3e119a242ea48a706026374d059dca7b18ab8c9b472cffc8be6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85bca42ee08d25610b5c763f6bef36864efb2b5f72ae0dfdcc0950c7487b9829
MD5 b74cfa4f47435d23353a1725f0395b6c
BLAKE2b-256 39acd0b7df299bf5b6e90cb42aa4c30101b17078fe7fb4f79ed5c8ef2edb308a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0442a93d497e910a0a8d415c50a219294b5f1ab99b88779daa0a4dfc5b8d64b9
MD5 d29ae78e9961fc06c6c4fffd73e35c05
BLAKE2b-256 c210d9fb0fed2ed2d7e950dca0857d72404f4451b717a214540f6a7ce2df67e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catsu-0.1.6-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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 56270153cf15456f9976542ceea489f62b805678c99382ad568023b967dfa43c
MD5 19f1991b8d3123b027da4d879b74f255
BLAKE2b-256 90edd1308c128c9f5f67f19d57a5caf0a314175b2801a3b334e3be9bf8841493

See more details on using hashes here.

File details

Details for the file catsu-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a29fbbf7b397a709daf2873859c50acf24f29aadc76d953e3663014e0833532c
MD5 595aa2b0c2273243da4980b7a75fb572
BLAKE2b-256 f6ebcb954b9a05c0d5905406fff45e09dac2e2aecae9ff07360169983cddd73c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f1c989fbcd85fe83e7e15da1d2bb74a0d4e8feb14266b5e2d61cc49939838fa
MD5 a024e51310bb0edeeef24897d7413eb4
BLAKE2b-256 4749a140d06b5377abff6930bd898b9c6ac78814d0210c2f9ba906bed6fbd3e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 855ab6255080fccbc593e84ee7103becd9febb4165bbee7e64630b45f594ead8
MD5 0daca0572891df8b7d7968451cf64921
BLAKE2b-256 6bf44a28131c5f63abdd27196e6f2c580e9a2bfc052b475ec2563df67cd6fea5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catsu-0.1.6-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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7985eddf888a09a8d209085297324161d381230df8fe7845b6d6566fd4e6074a
MD5 d326288f73bedfb922293bbc1b087fec
BLAKE2b-256 2acc3c1e951cf234a793e66edfce240e52a273776fdde77d0f9ffd66eda8758e

See more details on using hashes here.

File details

Details for the file catsu-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 28d101d849f1c7ef32a29423e9fe1395249a01d845c55f4a951ca688013d7040
MD5 369eda2ed599ded606c14ca1c3149887
BLAKE2b-256 0e0de8f61fe3d6f717613ba14fd04dc48724eb6b6ce20b1694b84081bb98663b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 630e4fcfd546ce3e5fad818f17555ce6e66d0ec94aafa6ae6c3bc1eee1a7cf38
MD5 fc7f57eea120ed93e6a445298d758732
BLAKE2b-256 fc758e171d085c1bf639ebd713b4b2b2f5d0b2e4665381ef111bfcf9fcff1206

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6829e15aea6bb69069b65e8173a116452bdf17e4cf49ca5b52a75465fd4c113c
MD5 96b0206cfd461723b5fdb6df8b1aae5b
BLAKE2b-256 ddc834adb5b214f19130eca4d88405a232ef5231206b7d71c912c303a95cf0c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: catsu-0.1.6-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.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ed29ff6ebcd9774398e4213d2d1a1e6b7f0a3268d3e3ab57c86f1cb53a377c1f
MD5 3d371ac72f2bb185bd01ee3cfad3025b
BLAKE2b-256 40589496f06bad48a3bb26ac0dae9013a16f01f0fd0139850137443ff3c85ac2

See more details on using hashes here.

File details

Details for the file catsu-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for catsu-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 491b9f38ade2731ccf1c29cdd9ac0aff2524149c765fc20d6993ded3dce40a3d
MD5 c406af0514c024774e0aa9295c4d2cb7
BLAKE2b-256 b1f81f11224ecacb7488d72367a496d15fb70f5b35ace229a5888dfb8af78595

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb29985d01fcf5e30c72642c705fdf43dc5831aed344993ad8b13fd111b33ddd
MD5 b2279c41cad7c067a83fd79fef1864bf
BLAKE2b-256 1be2946ffc01da8c1b7124f7e0ae974fc3cb2717203a703577398089af349364

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for catsu-0.1.6-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2a67153638c05c89633727a2031b42267c8297f120b26ce0ff36339984e213c1
MD5 31b14f4c812f0f7ff764c268ec3f2d71
BLAKE2b-256 809e2249d0335070cf980bc56fe59a80160ba2f99fb2cf6177083025364bc621

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