Structured Outputs
Sutro’s SDK allows you to enforce a JSON schema for the outputs of your inference job. This can be useful if you want to ensure that the outputs of your inference job are in a specific format, or if you want to extract specific information from the outputs. To specify a schema for the outputs of your inference job, you can pass a Pydantic Model or a JSON schema to theoutput_schema
parameter in the SDK. If you pass a JSON schema, it must follow the json-schema.org specification.
On rare occasions, the model may not adhere to the provided schema and will produce invalid JSON; in this case, Sutro will return the raw, unparsed text. If you need help improving JSON adherence, please contact us.