# Repository Briefing: ArtificialAnalysis/Stirrup
> Source: https://repoforai.com/repo/ArtificialAnalysis/Stirrup (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/ArtificialAnalysis/Stirrup
- **Official Docs / Website**: https://stirrup.artificialanalysis.ai
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A+ (91/100 · Maintenance 35/35 · Adoption 16/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.2.2 (2026-11-20) — https://github.com/ArtificialAnalysis/Stirrup/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: MCP, Docker, API
- **Momentum**: 747 ★ total (+1 24h / +10 7d) · 82 forks
- **Topics**: `agents`, `ai`, `ai-agent`, `ai-agents`, `python`
- **When to Use**: Best for: Python teams embedding agents for document analysis, web research, or file generation, where the model can choose its steps within an explicitly configured tool set. Skip if: You need a ready-to-use coding assistant, fixed workflow transitions and mandatory approvals out of the box, or production isolation without configuring tools and execution backends.

## Overview
```text
### Architecture & Core Mechanics
Stirrup is an embeddable Python SDK built around an async, model-directed tool loop. `Agent` takes a model client and tools; `agent.session()` manages tool setup, files, and cleanup. In the quick start, `await session.run(...)` returns finish parameters, history, and metadata. The loop stops when the model calls a finish tool or reaches a configured run limit. It does not require the application to define a workflow graph.

`Tool` uses Pydantic parameter models to define and validate inputs. `ToolProvider` handles lifecycle-bound resources such as temporary directories and HTTP clients. `default_tools()` creates fresh providers to avoid sharing session state across concurrent runs. Skills package domain instructions, while MCP support is on the client side: the SDK consumes server-provided tools and resources.

### Key Capabilities & Differentiators
The default tool set combines local shell execution in a temporary working directory with web fetch and search. Docker and E2B offer additional execution backends, and web search requires `BRAVE_API_KEY`. Sessions support file inputs and outputs, image, video, and audio inputs with format conversion, and a built-in user-input tool for clarification or feedback during a run.

For inference, use `ChatCompletionsClient` against an OpenAI-compatible endpoint, the optional `LiteLLMClient`, or a custom client. Examples cover OpenRouter and DeepSeek, with vLLM and Ollama listed as compatible endpoint options. Automatic history summarization helps manage context near the configured window. That is distinct from `max_turns` and the run-wide `max_cumulative_output_tokens`: those settings limit execution, not the size of the model's context window.

### Trade-offs & Limitations
A model-directed loop saves developers from encoding every step of an open-ended task, but the order of tool calls is not a policy guarantee. Compared with a workflow-first engine, Stirrup leaves mandatory approvals and deterministic transitions to the application. Compared with a ready-to-use coding agent such as Claude Code or Codex, it offers control over the client, tools, and session lifecycle, but the team has to build the end-user experience.

The default tool surface deserves an explicit deployment decision: a temporary working directory is not, by itself, a security boundary. Select only the tools a workload needs, and review filesystem access, egress, and credential exposure on the chosen backend. Turn and output-token limits are useful budget controls, but neither substitutes for application-level timeouts or cost controls.

### Hardware & Deployment Guide
Install `stirrup` with pip or uv on Python 3.12 or newer. The package is classified as beta and lists macOS and Linux. Install only the extras you use: `litellm`, `docker`, `e2b`, `mcp`, or `browser`. For the OpenRouter example, set `OPENROUTER_API_KEY`; without `BRAVE_API_KEY`, runs can still proceed but search is unavailable. A local compatible model endpoint can remove the hosted inference dependency, but enabled web tools, remote MCP servers, and hosted sandboxes still need their respective network access.

v0.2.0 hardened execution command allowlists and blocked private destinations in web fetch. v0.2.1 added `CompactionRequiredError` and changed overflow handling to compact rather than just drop the turn. v0.2.2 added a cumulative output-token limit across a run. For production, test the application against version upgrades and size the orchestration process separately from inference and tool workloads.
```

## Key Capabilities
```text
- Execution loop: Agent stops at a finish-tool call or a configured run limit; v0.2.2 adds max_cumulative_output_tokens.
- Session lifecycle: session() manages setup, files, and cleanup; default_tools() returns fresh stateful providers.
- Extension points: Define Pydantic-backed tools, use ToolProvider for resource ownership, and consume tools and resources through an MCP client.
- Execution backends: Local shell execution by default, with optional Docker and E2B backends.
- Model integration: OpenAI-compatible Chat Completions endpoints, optional LiteLLM, or an application-supplied client.
- Context and artifacts: Automatic history summarization, file inputs and outputs, and image, video, and audio conversion.
```

## Quick Start / Clone
```bash
# Core framework
pip install stirrup      # or: uv add stirrup

# With all optional components
pip install 'stirrup[all]'  # or: uv add 'stirrup[all]'

# Individual extras
pip install 'stirrup[litellm]'  # or: uv add 'stirrup[litellm]'
pip install 'stirrup[docker]'   # or: uv add 'stirrup[docker]'
pip install 'stirrup[e2b]'      # or: uv add 'stirrup[e2b]'
pip install 'stirrup[mcp]'      # or: uv add 'stirrup[mcp]'
pip install 'stirrup[browser]'  # or: uv add 'stirrup[browser]'
```
