The `whylabs-client` is a Python client library that provides a convenient way to interact with the WhyLabs API for end-to-end AI observability. It enables users to manage models, datasets, and monitors on the WhyLabs Platform. The library is automatically generated by the OpenAPI Generator project. Current version is 0.6.16.
pip install whylabs-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the WhyLabs API client with an API key. It uses environment variables for secure credential management and sets up the basic `Configuration` and `ApiClient` objects. Replace `api_key_api` with the specific API module you intend to use (e.g., `dataset_profile_api`, `data_api`). Ensure your `WHYLABS_API_KEY` is set as an environment variable.
Users should be aware that the library and platform are now community-driven. Consider exploring the open-source platform directly or `whylogs` for profiling, which remains actively maintained.
Instead of `import whylabs_client.api` or `from whylabs_client import api`, use specific imports like `from whylabs_client.api.your_api_module import YourApiClass` and `from whylabs_client.model.your_model import YourModel`.
Review WhyLabs' API limits documentation. Implement exponential backoff and retry logic in your application. Optimize profile uploads to stay within daily/hourly limits, e.g., by merging profiles before uploading if possible.
Refactor imports to be more specific, e.g., `from whylabs_client.api.your_api_module import YourApiClass` and `from whylabs_client.model.your_model import YourModel`. Alternatively, increase Python's recursion limit with `sys.setrecursionlimit(new_limit)` (use with caution).
Implement retry mechanisms with exponential backoff. Review your data ingestion strategy to ensure it adheres to WhyLabs' profile and rate limits. Consider aggregating data locally before uploading or adjusting your upload frequency.
If duplicate profiles are not desired, ensure your logging mechanism only uploads a unique profile for a given time granularity. To remove existing duplicates, a new model might need to be created and backfilled with correct data, or contact support for options if still available.