Quickstart
Create a deployment key in the API Keys panel of your Sutro UI, then configure the deployment before running these examples: If the panel is not visible, contact the Sutro team at [email protected] to create a key for you./v1
appended. You can persist the same values with sutro login instead.
Using the Python SDK
Here’s the simplest way to run a job with Sutro - just pass a list of inputs and a system prompt.Structuring outputs
In the above example, we’re trying to perform a simple classification task. In such cases, we may want structured outputs. We can accomplish this by passing in a Pydantic model or JSON schema using theoutput_schema parameter. The model will strictly adhere to this schema in its output content.
Working with DataFrames and Sampling Parameters
This example shows how to work with DataFrames, customize sampling parameters, and wait for job completion.Multi-Model Comparison
Run the same inputs across multiple models to compare outputs and quality.Cost Estimation
Before submitting production work, inspect your row and token quotas withso.get_quotas() or sutro quotas. See Increasing Quotas if the input exceeds your priority-1 limits.
You can request an estimate with dry_run=True. The SDK prints the estimate and returns the estimate job ID; it does not return the estimate value.
Using Files
You can also use files to pass in data. We currently support CSV, Parquet, and TXT files. If you’re using a TXT file, each line should represent a single input. If you’re using a CSV or Parquet file, you must specify the column name that contains the inputs using thecolumn parameter.
Moving to Production
So far we’ve shown prototyping jobs (priority 0, the default). For a production job, use priority 1 and give Sutro a presigned HTTPS GET URL for a private Parquet object in Amazon S3. This keeps the submission request small and avoids loading the full production dataset into the SDK process. Install Boto3 if your signing environment does not already include it:s3:GetObject; the producer identity needs s3:PutObject. If bucket versioning is enabled, capture the uploaded version ID and follow the version-pinning example in Presigned S3 Inputs.
obtain_results=False returns None for success, failure, cancellation, and timeout, so confirm SUCCEEDED as shown. Then request a Parquet download URL from GET /jobs/{job_id}/results-url?format=parquet and download urls.get; see Presigned Results URLs.
S3 evaluates expiration when a request starts, and a download started before expiration can finish afterward. Sutro currently issues one full-object GET and does not resume a failed input download; inspect the original job before creating a fresh URL and replacement job. Treat the full URL as a temporary credential, keep it out of logs and source control, and retain the immutable source object until results are reconciled. For version pinning, KMS permissions, retention, and troubleshooting guidance, see Presigned S3 Inputs.