Skip to main content

A ultra-high performance package for sending requests to Baseten Embedding Inference'

Project description

High performance client for Baseten-Embeddings

Usage with Baseten Embeddings

pip install truss_client_bei
from truss_client_bei import OpenAIEmbeddingsResponse, RerankResponse, SyncClient

api_key = os.environ.get("BASETEN_API_KEY")
api_base_embed = "https://model-yqv0rjjw.api.baseten.co/environments/production"

client = SyncClient(api_base=api_base_embed, api_key=api_key)

assert client.api_key == api_key
response = client.embed(
    ["Hello world", "Hello world 2", ".."],
    model="my_model",
    # mini batch size
    batch_size=4,
    # send up to 32 mini-batch-sizes at once.
    max_concurrent_requests=32,
    # set a timeout
    timeout_s=360,
)

Develop

apt-get install patchelf
pip install maturin[patchelf]
maturin develop
pytest tests

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

baseten_inference_client-0.0.1rc0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

baseten_inference_client-0.0.1rc0-cp38-abi3-manylinux_2_34_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ x86-64

File details

Details for the file baseten_inference_client-0.0.1rc0.tar.gz.

File metadata

File hashes

Hashes for baseten_inference_client-0.0.1rc0.tar.gz
Algorithm Hash digest
SHA256 c9f942afd81bed8535c7da3a70ee30d854a38e26e72423e5fc74707414a82909
MD5 67b6fb114a9d86b25e7916aa7d10d20e
BLAKE2b-256 731949d8eb1ce76d141a81e1c611fef1d1eb2eefef7c7671ec4f82d0e04230e0

See more details on using hashes here.

File details

Details for the file baseten_inference_client-0.0.1rc0-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for baseten_inference_client-0.0.1rc0-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 185a236714501a3467bcecf8a00cc338931e58f240bb01a299f6835108f83ed8
MD5 723bfa2e0ea2bad352abbdd59b440eb2
BLAKE2b-256 0ac06583749df42744681712404f9d98b95e8ed6f3799e90d71eec3ac137f66a

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