Skip to main content
Nimble accepts the System One request format, so you can call Nimble with TypeSafe’s Python SDK, typesafe-sdk. This is the Python SDK that these docs use.

Install

Point the SDK at Nimble

Set the base URL to Bespoke Labs, the key to your Bespoke Labs key, and the model to nimble-latest.
You can also set these with environment variables and create the client with no arguments.

Ask questions

Choose a model for one request

The client’s model is the default for every request. To use a different model for a single request, pass model to system_one. This request names nimble-v4-max, so it stays on that model when nimble-latest moves:
The overview lists every model name.

Retries

The SDK retries failed requests by itself. By default it makes up to 2 retries within 30 seconds, waits as long as a Retry-After header asks, and retries timeouts, connection errors, and the statuses 408, 429, and every 5xx. That includes 504, which Nimble returns when a request takes too long. For a 504, send fewer questions or a shorter state instead of retrying the same request. To retry only the statuses that Nimble marks as retryable, pass a RetryPolicy when you create the client:
RetryPolicy also sets the number of retries (max_retries) and the total time for one call, retries included (timeout). max_retries=0 turns retries off. To change the policy for a single request, pass retry to system_one. AsyncTypeSafeClient takes the same argument. The SDK already retries, so don’t wrap its calls in a retry loop of your own. Change the RetryPolicy instead.

Async