# Darwin > Darwin is an open-source, MIT-licensed evolutionary optimizer for AI agents. Give it a task and it evolves the whole agent that solves it: the system prompt, the tool code the agent writes for itself, and the model it runs on. Every variant runs in an isolated sandbox, is scored by a grader it cannot modify, and is rolled back if it regresses. Darwin is self-hosted and open source. There is no hosted API and no signup; agents interact with it through the `darwin` CLI or the local HTTP and WebSocket API described below. Every page on this site is also served as Markdown: request it with `Accept: text/markdown`, or append `.md` (the homepage is /index.md). ## When to use Darwin Reach for Darwin when the job is to find the best agent configuration for a specific, measurable task, not to answer a one-off question. Good fits: - You have a task with a programmatic grader (unit tests, exact-match answers, an LLM judge you trust) and want the highest-scoring agent for it. - You need to choose which LLM to route each kind of task to, based on scores on your own tasks rather than public leaderboards. - You want an agent to improve its own prompt and tool code without that code ever running on the host machine. - You need an auditable record of every variant, score, rollback, and model choice for a review or a demo. Poor fits: tasks with no way to score an answer, real-time chat, or anything that needs a hosted API (Darwin is self-hosted). ## How an agent should use Darwin - Install the CLI (`brew tap karthiksubramanian07/darwin https://github.com/KarthikSubramanian07/Darwin && brew install trydarwin`) and run `darwin --offline` for a deterministic, key-free evolution run; read the fitness curve from stdout. - Run `darwin-server` to start the local HTTP and WebSocket API on 127.0.0.1:8000, then `POST /api/run` with `{"task": "coding_bench", "offline": true}` and stream events from `WS /ws`. - Poll `GET /api/status` to see whether a run is active. Run records are written as JSON under `~/.darwin/runs/` (or `data/runs/` in a clone; override with `DARWIN_DATA_DIR`). - Add your own task as a JSON file under `~/.darwin/task/` (or `data/task/` in a clone) and pass its id with `--task`. ## Docs - [Darwin for developers](https://trydarwin.pages.dev/developers.md): quickstart, CLI flags, local API endpoints, configuration keys, offline sandbox mode - [Darwin: the evolutionary optimizer for AI agents](https://trydarwin.pages.dev/index.md): what Darwin is, how a generation works, and the safety guarantees - [Darwin Lab: the best LLM for every task in your business](https://trydarwin.pages.dev/app.md): the Lab: benchmark models per task and export a routing strategy - [README](https://github.com/KarthikSubramanian07/Darwin#readme): architecture, design decisions, and the full pitch ## Company - [About Darwin](https://trydarwin.pages.dev/about.md): who builds Darwin and why - [Contact Darwin](https://trydarwin.pages.dev/contact.md): GitHub issues for bugs, email for security reports - [Privacy policy](https://trydarwin.pages.dev/privacy.md): what this site collects and where run data goes ## Optional - [Source code](https://github.com/KarthikSubramanian07/Darwin): Python engine and React dashboard, MIT license - [Sitemap](https://trydarwin.pages.dev/sitemap.xml): every indexable URL