The TrueFoundry Python SDK provides convenient access to the TrueFoundry API, enabling users to programmatically interact with the platform. It supports managing applications, deployments, workspaces, and offers capabilities for ML experiment tracking and interacting with ML repositories. The SDK is currently at version 0.2.0 and has an active release cadence, with frequent updates. It is designed to work with the TrueFoundry MLOps platform, which includes an AI Gateway, deployment tools, and observability features.
pip install truefoundry-sdkVerified import paths — ran on the pinned version, not inferred.
Initializes the TrueFoundry client using an API key and base URL. It then demonstrates how to list applications within a specified workspace. Remember to replace placeholder values with your actual TrueFoundry API key and workspace FQN, preferably by using environment variables.
Remove the `include_virtual_accounts` argument from calls to `client.users.list()`.
Review your code for usage of TrueFoundry SDK type fields and update according to the latest SDK documentation or by inspecting the new data structures if your code relies on them.
For contributions, it is recommended to open an issue first to discuss changes. Contributions to the README are generally welcome and do not face this issue.
Be mindful of which client (`TrueFoundry` from `truefoundry_sdk` or `get_client()` from `truefoundry.ml`) is appropriate for your desired interaction (e.g., platform management vs. ML experiment tracking).
Always ensure your `api_key` is valid and your `base_url` correctly points to the intended TrueFoundry endpoint or Gateway. Use environment variables for sensitive credentials.
Call `tf.configure(host="YOUR_TRUEFOUNDRY_HOST", token="YOUR_AUTH_TOKEN")` at the beginning of your script, providing your TrueFoundry host URL and API token.
Verify that the `token` and `host` provided to `tf.configure()` are correct and that the token is still valid. You might need to generate a new API token from your TrueFoundry account.
Use the correct method name: `tf.ml.log_metric(...)`.
Provide the `ports` argument as a dictionary, for example: `ports={"http": 8080}`.