An open API service indexing awesome lists of open source software.

https://github.com/g-eoj/guided-agents

Use structured output to control agents.
https://github.com/g-eoj/guided-agents

agents mlx vllm xgrammar

Last synced: 16 days ago
JSON representation

Use structured output to control agents.

Awesome Lists containing this project

README

          

# Guided Agents

This is a fork of the awesome [smolagents](https://github.com/huggingface/smolagents) library.
The goal of this fork is to integrate structured output.

## Why structured output?

### Reliable outputs

Instead of hoping one or few shot prompting will produce the desired output, structured output allows you to define a schema (or pretty much any structure) for the output.
This way, you can ensure that the output is always in a parsable format without prompt engineering time waste.

### Reduced token consumption

#### Control reasoning

Structured output opens up different strategies for limiting reasoning output.
This can make a difference with token hungry reasoning models while still maintaining good performance.

#### Short system prompts

Another advantage of not requiring one/few shot prompting is faster processing and reduced token consumption.
It is worth noting prompt caching has a similar effect.

## Where to start?

The is repo is a playground, and thus breaking changes are expected.
That said, please look at the [examples](https://github.com/g-eoj/guided-agents/blob/main/example/core.py) to get an idea of how these ideas come together.