Skip to main content
Agno supports a modular output model pipeline for response refinement when required. Use secondary model if you need to refine the response or validate the response from the primary model.

How it works

  1. Primary model generates response (Optionally feed this as intermediate response to the secondary model)
  2. Optional Secondary model processes intermediate response, formats and returns the final response
  3. Optionally, the final response can be further custom styled and validated

Model Selection

Design your agent based on three dimensions: Reasoning (Logic), Presentation (Style), and Structure (Schema).
  • Single model (model): Select the ‘doer’ or ‘pipeline brain’ based on reasoning capability (for example, GPT-4o for complex tasks, Claude-3 for simple ones).
  • Single model with output refinement (output_model): In single model pipeline, select the ‘formatter’ or ‘pipeline stylist’ based on formatting capability (for example, Claude Opus 4.5 for prose, GPT-5-mini for cost optimization).
  • Multi-model (parser_model): Add a secondary model if the primary model is weaker or the output is not structured or needs refinement.(For example, with OpenAI/Anthropic, use parser_model with a smart model (for example, Claude 4.5 or later) to “fix” or “extract” desired output).
Use these parameters to select the desired output model pipeline:
  • model: Mandatory, specifies the primary model to generate a response
  • output_schema: The schema to validate the response against
  • output_model: When using single model, if the model does not support structured output, use this to validate the response
  • output_model_prompt: Optional, used in conjunction with output_model to specify additional custom formatting to refine output
  • parser_model: The secondary model used to further refine the intermediary response for better outcomes
  • parser_model_prompt: Optional, used in conjunction with parser_model to specify additional instructions to control the parser_model output

Use cases

Custom Output Style

output_model_prompt

Use output_model_prompt optionally whenever you use an output_model to set the style, tone, and format for the final output. It replaces the default System Prompt for the specified output_model.
Default Behavior (if you don’t set output_model_prompt):Without output_model_prompt, the output_model will just summarize/rewrite the content in its default voice, which may not be what you want.When to use it:Use it to set the tone (Write a professional, executive summary), format (Format as technical documentation with code examples where relevant), or audience (Explain to a layman or ELI5) for the response.

parser_model_prompt

The parser_model_prompt is optional. In most cases,the default system prompt works well for secondary model. Use it optionally whenever you use a secondary parser_model to set the style, tone, and format for the final output.
Default Behavior (if you don’t set parser_model_prompt):The specified parser_model prompt defaults to: “You are tasked with creating a structured output from the provided user message.” (or similar).When to use it:You only need to set this if the default extraction fails or if you need to provide specific rules for how to extract the final output data (for example, “Extract dates in YYYY-MM-DD format” or “Extract only the first 3 items”).

Examples

Better Writing

GPT-5.2 excels at research and tool use, but Claude Opus 4.5 produces better prose. Combine them:
The primary model gathers information from HackerNews. Claude Opus 4.5 transforms those findings into polished prose.

Cost Optimization

Use a capable but expensive model for complex reasoning, a cheaper model for formatting:
Or use a cheaper reasoning model with a better formatting model:

Structured Output Support

Some models lack native structured output. Use an output model that supports it: