> ## Documentation Index
> Fetch the complete documentation index at: https://simplellmfunc.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# SimpleLLMFunc

> Build typed LLM agents with Python functions

# SimpleLLMFunc

**LLM calls as typed Python functions. Context compiled from prompts, history, and runtime patches. Prompts as code.**

SimpleLLMFunc is a framework for building LLM-powered agents where every LLM interaction is a normal Python function call — typed, testable, and composable. No chains, no graphs, no YAML. Just functions.

***

## Choose Your Path

<CardGroup cols={3}>
  <Card title="Start Building" icon="rocket" href="/quickstart">
    Get a working agent in 5 minutes. Install, configure, run.
  </Card>

  <Card title="Understand the Model" icon="brain" href="/philosophy/llm-is-function">
    Learn why SimpleLLMFunc works the way it does. Three short essays on design philosophy.
  </Card>

  <Card title="API Reference" icon="book" href="/api/decorators">
    Jump straight to signatures, types, and parameters.
  </Card>
</CardGroup>

***

## What Makes This Different

### LLM is Function

```python theme={null}
@llm_function(llm_interface=llm)
async def analyze(text: str) -> SentimentReport:
    """Classify sentiment. Return structured report."""
    pass

result = await analyze("Great product, terrible shipping.")
print(result.sentiment)  # "mixed"
```

No SDK boilerplate. No message list construction. The decorator handles context compilation, type parsing, and structured output extraction. You write a function signature and a docstring.

### Context-Centric

Every LLM call is compiled into a provider-facing message list. The compiler combines invocation configuration (docstrings, template values, tool guidance), the base transcript/history, and internal runtime patches. Those patches are represented as **mutations** so LLM calls, tools, SelfRef, and abort handling do not directly edit the live transcript.

### Prompt as Code

Your docstring IS the system prompt. It lives next to the code that uses it, versions with git, and benefits from IDE tooling. No separate prompt files, no template engines, no drift between what you wrote and what the model sees.

***

## The Stack at a Glance

```
┌─────────────────────────────────────────┐
│         Your Agent Code                  │
│   @llm_function / @llm_chat / @tool     │
├─────────────────────────────────────────┤
│         Compile Boundary                 │
│   Config + Transcript + Patches → LLM   │
├─────────────────────────────────────────┤
│         ReAct Runtime                    │
│   Event stream, tool scheduling, abort  │
├─────────────────────────────────────────┤
│         Interface Layer                  │
│   OpenAICompatible / ResponsesCompatible│
└─────────────────────────────────────────┘
```

<Card title="Ready to build?" icon="code" href="/quickstart">
  Start with a 5-minute quickstart that gets you from zero to a working LLM function call.
</Card>
