Overview
Thecognesy/instructor-struct package works without any published configuration
files. All structured-output behavior is controlled through typed configuration
objects in code.
When configuration files are present in a project, they typically serve the
companion Polyglot package (provider presets) rather than the structured-output
package itself.
Provider Presets
LLM provider connections are configured through YAML preset files managed by thecognesy/polyglot package. Each preset defines the API URL, driver, model, token
limits, and other provider-specific settings:
LLMConfig::fromPreset():
config/
directory, monorepo paths, and Composer vendor paths), so presets work out of the
box in most setups.
Configuration Groups
In the broader InstructorPHP ecosystem, configuration is organized into groups. Each group is stored in a separate file. The main groups are:| Group | Purpose |
|---|---|
llm | LLM provider connections and presets |
structured | Structured output behavior (output mode, retries, prompts) |
embed | Embedding provider connections |
http | HTTP client configurations |
prompt | Prompt libraries and settings |
web | Web service providers (scrapers, etc.) |
debug | Debugging settings |
structured and llm groups.
Other groups belong to companion packages.
Structured Output Configuration
Rather than reading from config files, the structured-output package uses theStructuredOutputConfig class directly:
fromArray() or fromDsn()).