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

# Examples

> Runnable examples for every primitive: functions, a DuckDB warehouse on a volume, ASGI apps, and agents from minimal to production shaped.

Every example lives in the
[SDK repository](https://github.com/Cycls/cycls/tree/main/examples) and runs with
the CLI.

```bash theme={null}
git clone https://github.com/Cycls/cycls
cd cycls
uv sync --group test
uv run cycls run examples/functions/hello.py --n 8
```

Agent examples read provider keys from `.env` inside the container. Keep
`CYCLS_API_KEY` in `.env` on your machine and `ANTHROPIC_API_KEY` in
`.providers.env`, which the image copies in as `.env`.

## Functions

| Example | Shows |
| - | - |
| `functions/hello.py` | the smallest function, and argument binding from the CLI |
| `functions/dev_loop.py` | `--remote`, `local_entrypoint`, and `.map()` |
| `functions/fanout.py` | one call per item across instances, errors returned as data |
| `functions/warm_model.py` | an embedding model loaded once per instance |
| `functions/toolchain.py` | apt packages and an arbitrary toolchain in the image |
| `functions/nightly.py` | a scheduled function writing to a volume |

Documented in [Functions](/build/functions) and [Batch jobs](/guides/batch-jobs).

## Warehouse

| Example | Shows |
| - | - |
| `warehouse/ingest.py` | CSV to partitioned Parquet, a nightly schedule, a backfill |
| `warehouse/query.py` | DuckDB over the partitions on a read-only mount |
| `warehouse/analyst.py` | an agent that calls the deployed query endpoint as a tool |

Documented in [Build a data warehouse](/guides/duckdb-warehouse).

## Apps

| Example | Shows |
| - | - |
| `apps/api.py` | the smallest app, and the `--remote` dev URL |
| `apps/notes/` | an inverted index over `cycls.DB`, with a bundled front end |
| `apps/terminal/` | a per-user sandboxed shell using `cycls.Sandbox` |

Documented in [Apps](/build/apps) and [Serve a FastAPI app](/guides/fastapi-app).

## Agents

| Example | Shows |
| - | - |
| `agents/minimal.py` | the smallest agent, with built-in tools and cost tracking |
| `agents/tools.py` | custom tool schemas, handlers, labels and a component return |
| `agents/open_model.py` | DeepSeek, Kimi, GLM and your own vLLM or SGLang server |
| `agents/super.py` | production shape: branding, CMS, workspaces, analytics, quotas |
| `agents/catalog.py` | a connector catalog declared once and shared |

Documented in [Agents](/agents/overview) and
[Build your first agent](/guides/first-agent).

## Services

| Example | Shows |
| - | - |
| `browser_service/` | deploying the shared browser service the `Browser` tool calls |

## Related repositories

<CardGroup cols={2}>
  <Card title="SDK" icon="github" href="https://github.com/Cycls/cycls">
    Source, tests and examples.
  </Card>

  <Card title="Cookbook" icon="book" href="https://github.com/Cycls/cookbook">
    Longer end-to-end builds.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.