Constrained generation framework that forces LLM output into regex, grammar, or selection formats from Microsoft Research.
- CCM score
- 61 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 14.9K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers regex and grammar constraints, selection among fixed choices, token healing, and reusable
@guidancefunctions for multi-step workflows - Guarantees valid JSON, XML, dates, emails, and other formats by filtering invalid tokens during generation
- Supports OpenAI, Anthropic, Hugging Face Transformers, and llama.cpp backends through a single Python API
- Designed for developers who need structured LLM output without retry loops or post-hoc parsing
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill guidance -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Guidance: Constrained LLM Generation
When to Use This Skill
Use Guidance when you need to:
- Control LLM output syntax with regex or grammars
- Guarantee valid JSON/XML/code generation
- Reduce latency vs traditional prompting approaches
- Enforce structured formats (dates, emails, IDs, etc.)
- Build multi-step workflows with Pythonic control flow
- Prevent invalid outputs through grammatical constraints
GitHub Stars: 18,000+ | From: Microsoft Research
Installation
# Base installation
pip install guidance
# With specific backends
pip install guidance[transformers] # Hugging Face models
pip install guidance[llama_cpp] # llama.cpp models
Quick Start
Basic Example: Structured Generation
from guidance import models, gen
# Load model (supports OpenAI, Transformers, llama.cpp)
lm = models.OpenAI("gpt-4")
# Generate with constraints
result = lm + "The capital of France is " + gen("capital", max_tokens=5)
print(result["capital"]) # "Paris"
With Anthropic Claude
from guidance import models, gen, system, user, assistant
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Category
- AI Agents & LLM Apps
- First seen
- Jun 3, 2026
Questions
What does the guidance skill do?
The guidance skill controls LLM output with regex and grammars, so output can be guaranteed to be valid JSON, XML or code. It also enforces structured formats such as dates, emails and IDs, and builds multi-step workflows with Pythonic control flow. It is based on Guidance, Microsoft Research's constrained generation framework.
How do I install the guidance skill?
Run npx -y skills add orchestra-research/ai-research-skills --skill guidance -y in your project to install it. After that, the agent can use Guidance to constrain model output with regex, grammars and selection choices.
Which AI agents and models does guidance work with?
The skill's examples show Guidance working with Anthropic Claude, OpenAI, local Hugging Face Transformers models and llama.cpp models. It needs the guidance Python package, installed with pip, plus transformers when using Hugging Face models.
Where does guidance rank in the AI Agents & LLM Apps category?
Guidance is listed in the AI Agents & LLM Apps category on Claude Marketplaces, alongside skills such as microsoft-foundry and azure-ai. It sets itself apart by focusing on token-level constrained generation so model outputs match a required syntax.
More from orchestra-research/ai-research-skills
All 92- Nnsight Remote Interpretability1.1K
- Rwkv Architecture1.1K
- Implementing Llms Litgpt1.1K
- Llamaguard1.1K
- Nemo Guardrails1.1K
- Llava1.1K
- Blip 2 Vision Language1.1K
- Miles Rl Training1.1K
- Nemo Evaluator Sdk1.1K
- Torchforge Rl Training1.1K
- Autogpt Agents1.1K
- Constitutional Ai1.1K
- Pinecone1.1K
- Skypilot Multi Cloud Orchestration1.1K
- Systems Paper Writing1.1K
- Langsmith Observability1.1K
- Phoenix Observability1.1K
- Lambda Labs Gpu Cloud1.1K
- Experiment Tracking Swanlab1K
- Fine Tuning Openvla Oft1K
- Fine Tuning Serving Openpi1K
- Evaluating Cosmos Policy1K
- Evolving Ai Agents986
- Ml Paper Writing2.6K
Similar to Guidance
More AI Agents & LLM Appsoutlinesorchestra-research/ai-research-skills1.1K installsGuaranteed-valid structured generation with Pydantic models, JSON schemas, and local model backends.
sglangorchestra-research/ai-research-skills1.1K installsFast LLM serving with RadixAttention prefix caching for structured JSON, regex, and agentic tool-call outputs.
prompt-masternidhinjs/prompt-master5K installsStructured system prompt that turns rough ideas into ready-to-paste prompts tuned for specific AI tools and models.
prompt-engineercuriositech/some_claude_skills220 installsExpert prompt optimization that diagnoses inconsistent LLM outputs and rewrites prompts with measurable constraints.
openai-prompt-engineerjamesrochabrun/skills211 installsStructured prompt-writing guide covering chain-of-thought, few-shot, XML structuring, and per-model tuning for GPT-5 and Claude.