The `baseten-performance-client` is a Python library designed for ultra-high performance interactions with Baseten's inference endpoints, particularly for embedding models. It provides a simple client interface for sending prediction requests. As of the current version `0.1.5`, it primarily focuses on optimizing HTTP requests to Baseten services. Its release cadence is tied to Baseten's internal development cycles, with updates typically driven by specific performance or feature needs.
pip install baseten-performance-clientVerified import paths — ran on the pinned version, not inferred.
Initialize the `PerformanceClient` with your Baseten API key and make a prediction request to a specified model ID. The API key can be passed directly or set as the `BASETEN_API_KEY` environment variable.
Ensure the `BASETEN_API_KEY` environment variable is set, or pass `api_key` directly to the `PerformanceClient` constructor or `predict` method.
Consult your Baseten model's API documentation or the model's 'deploy' tab on the Baseten platform for the exact expected input format (e.g., keys, types, array structures).
Understand that 'performance' here refers to optimized HTTP usage. For truly extreme low-latency scenarios, consider alternatives or ensure your Baseten model is optimized for such throughput. Be mindful of its blocking nature when integrating into existing asynchronous applications.
Verify your `BASETEN_API_KEY` environment variable or the `api_key` argument. Generate a new API key from your Baseten account settings if needed.
Double-check the `model_id` for typos. Ensure the model is deployed and you have the correct permissions to access it on the Baseten platform.
Review the specific error message for details on the validation failure. Compare your `input` structure (keys, data types, nested objects/arrays) against the model's documented API schema.