The Any-LLM SDK provides a unified Python interface for interacting with various Large Language Model (LLM) providers through the Any-LLM gateway. It aims to abstract away provider-specific complexities, offering a consistent API for chat completions, embeddings, and more. The current version is 1.13.0, and it maintains a rapid release cadence with frequent updates and improvements.
pip install any-llm-sdkVerified import paths — ran on the pinned version, not inferred.
Initializes the Any-LLM Gateway client using environment variables for the gateway URL and API key, then sends a simple chat completion request to a specified model. The `messages` types from `any_llm_sdk.types` (re-exporting Anthropic types) are used for constructing the payload.
Ensure `anthropic` is compatible with your environment or explicitly install `pip install any-llm-sdk anthropic`.
Review Anthropic provider calls and explicitly add the 'thinking_budget' parameter if you were relying on the default behavior for older models.
Always set `ANY_LLM_GATEWAY_URL` and `ANY_LLM_GATEWAY_API_KEY` in your environment before running applications that use the SDK.
Verify that the model name you are using (`model='...'`) is correctly configured and available through your Any-LLM Gateway instance.