mantismantis
selfhost

Guides

Topic-oriented walkthroughs. Pick the page that matches what you're trying to do; each one is self-contained.

!!! info "One shape, everywhere"

Every example in these guides uses `MantisAgentOptions` and the flat message
shape:
 
```python
from mantis_agent import MantisAgentOptions, query
 
 
async def main() -> None:
    async for msg in query(
        prompt="hi", options=MantisAgentOptions(model="qwen2.5:7b")
    ):
        if msg.type == "assistant":
            for block in msg.content:          # flat: msg.content
                print(getattr(block, "text", ""))
```
 
`query()` also accepts a plain **dict**, which yields the nested wire shape
(`msg.message.content`) for byte-level TS-SDK compatibility. It's a real,
supported API — it is just not the one these pages teach, because mixing the
two is the most common source of confusion here. The differences live in
exactly two places: [the two option shapes](models-and-backends.md#the-two-option-shapes)
and [How configuration works](how-it-works.md).

New here?

Start with Recipes — complete, runnable scripts for the common jobs — then dip into the reference pages below when you need detail.

By task