@evolvingmachines/evolve 0.0.55-project-sable.20260916.db0bc0bb → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.cjs +32 -32
- package/dist/cli/index.js +27 -27
- package/package.json +4 -6
- package/skills/evolve/SKILL.md +4 -3
- package/skills/evolve-evals/SKILL.md +112 -0
- package/{docs-evals → skills/evolve-evals/references}/cli-reference/run.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/cli-reference/skills.mdx +4 -4
- package/{docs-evals → skills/evolve-evals/references}/core-concepts/agents.mdx +2 -2
- package/{docs-evals → skills/evolve-evals/references}/core-concepts/analyze.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/core-concepts/jobs.mdx +3 -3
- package/{docs-evals → skills/evolve-evals/references}/core-concepts/models.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/core-concepts/sandboxes.mdx +2 -2
- package/{docs-evals → skills/evolve-evals/references}/core-concepts/secrets.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/core-concepts/trial-outputs.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/getting-started/quick-start.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/index.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/sdk/python.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/sdk/typescript.mdx +1 -1
- package/{docs-evals → skills/evolve-evals/references}/sdk-reference/errors.mdx +2 -2
- package/{docs-evals → skills/evolve-evals/references}/sdk-reference/jobs.mdx +2 -2
- package/docs-agents/SKILL.md +0 -138
- package/docs-agents/index.md +0 -81
- package/docs-agents/python/01-getting-started.md +0 -511
- package/docs-agents/python/02-configuration.md +0 -855
- package/docs-agents/python/03-runtime.md +0 -899
- package/docs-agents/python/04-streaming.md +0 -451
- package/docs-agents/python/05-swarm-pipeline.md +0 -953
- package/docs-agents/python/index.md +0 -122
- package/docs-agents/typescript/01-getting-started.md +0 -494
- package/docs-agents/typescript/02-configuration.md +0 -841
- package/docs-agents/typescript/03-runtime.md +0 -864
- package/docs-agents/typescript/04-streaming.md +0 -478
- package/docs-agents/typescript/05-swarm-pipeline.md +0 -957
- package/docs-agents/typescript/index.md +0 -121
- package/docs-evals/SKILL.md +0 -112
- package/docs-evals/docs.json +0 -180
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/agent.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/analysis.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/analyze.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/auth.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/check.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/dataset.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/index.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/job.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/secrets.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/skill.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/trial.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/cli-reference/upload.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/core-concepts/check.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/core-concepts/datasets.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/core-concepts/index.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/core-concepts/skills.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/core-concepts/tasks.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/core-concepts/trials.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/core-concepts/upload.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/dashboard/checks.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/dashboard/datasets.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/dashboard/jobs.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/dashboard/traces.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/dashboard/trial-viewer.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/getting-started/installation.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/agents.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/analyses.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/auth.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/checks.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/datasets.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/index.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/meta.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/skills.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/trials.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/sdk-reference/types.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/snippets/global-options.mdx +0 -0
- /package/{docs-evals → skills/evolve-evals/references}/snippets/list-flags.mdx +0 -0
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# Evolve Python SDK
|
|
2
|
-
|
|
3
|
-
Run CLI agents in secure sandboxes with built-in observability.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
pip install evolvingmachines-evolve
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
```python
|
|
10
|
-
from evolve import Evolve
|
|
11
|
-
|
|
12
|
-
evolve = Evolve()
|
|
13
|
-
await evolve.run(prompt='Hello world')
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Reference
|
|
19
|
-
|
|
20
|
-
### Getting Started
|
|
21
|
-
|
|
22
|
-
| Topic | Link |
|
|
23
|
-
|-------|------|
|
|
24
|
-
| Installation (Python 3.10+, Node.js 18+) | [Getting Started → Installation](./01-getting-started.md#installation) |
|
|
25
|
-
| Quick Start (3 steps) | [Getting Started → Quick Start](./01-getting-started.md#quick-start) |
|
|
26
|
-
| Core Lifecycle (run → get_output_files → kill) | [Getting Started → Core Lifecycle](./01-getting-started.md#core-lifecycle) |
|
|
27
|
-
| Streaming basics | [Getting Started → Streaming](./01-getting-started.md#streaming) |
|
|
28
|
-
| Gateway, managed BYO provider keys, and direct keys | [Getting Started → Authentication](./01-getting-started.md#authentication) |
|
|
29
|
-
| Gateway mode (EVOLVE_API_KEY) | [Getting Started → Gateway Mode](./01-getting-started.md#gateway-mode-evolve_api_key) |
|
|
30
|
-
| Managed BYO provider keys | [Getting Started → Managed BYO Provider Keys](./01-getting-started.md#managed-byo-provider-keys) |
|
|
31
|
-
| Managed secrets | [Configuration → Managed Secrets](./02-configuration.md#managed-secrets) |
|
|
32
|
-
| Direct provider key mode (local BYOK) | [Getting Started → Direct Provider Key Mode](./01-getting-started.md#direct-provider-key-mode-local-byok) |
|
|
33
|
-
| BYO Claude Max / Codex / Gemini subscription | [Getting Started → BYO Claude Max Subscription](./01-getting-started.md#byo-claude-max-subscription) |
|
|
34
|
-
| Supported agents & models | [Getting Started → Agent Reference](./01-getting-started.md#agent-reference) |
|
|
35
|
-
| Agent-specific options (reasoning_effort) | [Getting Started → Agent Reference](./01-getting-started.md#agent-reference) |
|
|
36
|
-
|
|
37
|
-
### Configuration
|
|
38
|
-
|
|
39
|
-
| Topic | Link |
|
|
40
|
-
|-------|------|
|
|
41
|
-
| Sandbox providers (E2B, Modal, Daytona) | [Configuration → Sandbox Providers](./02-configuration.md#sandbox-providers) |
|
|
42
|
-
| Provider auto-resolution from env | [Configuration → Sandbox Providers](./02-configuration.md#auto-resolution) |
|
|
43
|
-
| `sandbox_create_options=` (image, network, user, homeDir) | [Configuration → Sandbox Create Options](./02-configuration.md#sandbox-create-options) |
|
|
44
|
-
| `workspace_mode=` (knowledge / swe) | [Configuration → Workspace Modes](./02-configuration.md#workspace-modes) |
|
|
45
|
-
| Evolve instance (full constructor API) | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
46
|
-
| `AgentConfig` | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
47
|
-
| `sandbox=` provider | [Configuration → Sandbox Providers](./02-configuration.md#sandbox-providers) |
|
|
48
|
-
| `context=` / `files=` | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
49
|
-
| `system_prompt=` | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
50
|
-
| `schema=` (Pydantic / JSON Schema) | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
51
|
-
| `browser=` browser guide | [Configuration → Browser Automation](./02-configuration.md#browser-automation) |
|
|
52
|
-
| `browser_credentials=` browser logins | [Configuration → Browser Credentials](./02-configuration.md#browser-credentials) |
|
|
53
|
-
| `plugins=` | [Configuration → Agent Plugins](./02-configuration.md#agent-plugins) |
|
|
54
|
-
| `skills=` | [Configuration → Agent Skills](./02-configuration.md#agent-skills) |
|
|
55
|
-
| `integrations=` (managed app integrations) | [Configuration → Managed Integrations](./02-configuration.md#managed-integrations) |
|
|
56
|
-
| `managed_secrets=` | [Configuration → Managed Secrets](./02-configuration.md#managed-secrets) |
|
|
57
|
-
| `mcp_servers=` (STDIO / HTTP / SSE) | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
58
|
-
| `secrets=` | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
59
|
-
| `storage=` (checkpointing) | [Runtime → Storage & Checkpointing](./03-runtime.md#storage--checkpointing) |
|
|
60
|
-
| `session_tag_prefix=` (observability) | [Runtime → Observability](./03-runtime.md#observability) |
|
|
61
|
-
| Skills catalog (PDF, browser, research, etc.) | [Configuration → Agent Skills](./02-configuration.md#agent-skills) |
|
|
62
|
-
| Integration auth/account helpers | [Configuration → Managed Integrations](./02-configuration.md#managed-integrations) |
|
|
63
|
-
| Integration tool filtering | [Configuration → Managed Integrations](./02-configuration.md#managed-integrations) |
|
|
64
|
-
| MCP server config (McpServerConfig) | [Configuration → Evolve Instance](./02-configuration.md#evolve-instance) |
|
|
65
|
-
|
|
66
|
-
### Runtime
|
|
67
|
-
|
|
68
|
-
| Topic | Link |
|
|
69
|
-
|-------|------|
|
|
70
|
-
| `run()` | [Runtime → run](./03-runtime.md#run) |
|
|
71
|
-
| `execute_command()` | [Runtime → execute_command](./03-runtime.md#execute_command) |
|
|
72
|
-
| Streaming events (content, lifecycle, stdout, stderr) | [Streaming Events](./04-streaming.md) |
|
|
73
|
-
| OutputEvent / SessionUpdate types | [Streaming → Type Definitions](./04-streaming.md#type-definitions) |
|
|
74
|
-
| LifecycleEvent / LifecycleReason | [Streaming → LifecycleEvent](./04-streaming.md#lifecycleevent-typeddict-shape) |
|
|
75
|
-
| Tool events (ToolCall, ToolCallUpdate, ToolKind) | [Streaming → Type Definitions](./04-streaming.md#type-definitions) |
|
|
76
|
-
| Browser lifecycle event fields | [Streaming → Browser Automation Streaming](./04-streaming.md#browser-automation-streaming) |
|
|
77
|
-
| UI integration example | [Streaming → UI Integration Example](./04-streaming.md#ui-integration-example) |
|
|
78
|
-
| Upload files (`upload_context()`, `upload_files()`) | [Runtime → Upload](./03-runtime.md#upload-local--sandbox) |
|
|
79
|
-
| Download files (`get_output_files()`, `save_local_dir()`) | [Runtime → Download](./03-runtime.md#download-sandbox--local) |
|
|
80
|
-
| Session controls (interrupt, pause, resume, kill) | [Runtime → Session Controls](./03-runtime.md#session-controls) |
|
|
81
|
-
| `get_host()` (port forwarding) | [Runtime → get_host](./03-runtime.md#get_host) |
|
|
82
|
-
| Async context manager (`async with evolve:`) | [Runtime → Session Management](./03-runtime.md#session-management) |
|
|
83
|
-
| Workspace filesystem layout | [Runtime → Workspace & Structured Output](./03-runtime.md#workspace--structured-output) |
|
|
84
|
-
| Structured output (Pydantic / JSON Schema) | [Runtime → Workspace & Structured Output](./03-runtime.md#structured-output) |
|
|
85
|
-
| Multi-turn conversations | [Runtime → Session Management](./03-runtime.md#session-management) |
|
|
86
|
-
| Pause / resume | [Runtime → Session Management](./03-runtime.md#session-management) |
|
|
87
|
-
| Save and reconnect (`sandbox_id=`, `set_session()`) | [Runtime → Session Management](./03-runtime.md#session-management) |
|
|
88
|
-
| Storage & checkpointing (gateway) | [Runtime → Storage & Checkpointing](./03-runtime.md#storage--checkpointing) |
|
|
89
|
-
| Auto-checkpoint, explicit checkpoint, restore | [Runtime → Storage & Checkpointing](./03-runtime.md#auto-checkpoint-via-run) |
|
|
90
|
-
| Checkpoint lineage | [Runtime → Checkpoint Lineage](./03-runtime.md#checkpoint-lineage) |
|
|
91
|
-
| `storage()` client, `evolve.storage()` | [Runtime → Listing & Browsing Checkpoints](./03-runtime.md#listing--browsing-checkpoints) |
|
|
92
|
-
| `sessions()` client for past sessions & traces | [Runtime → Historical Sessions & Trace Download](./03-runtime.md#historical-sessions--trace-download) |
|
|
93
|
-
| Observability (dashboard + local logs) | [Runtime → Observability](./03-runtime.md#observability) |
|
|
94
|
-
| Error handling | [Runtime → Error Handling](./03-runtime.md#error-handling) |
|
|
95
|
-
|
|
96
|
-
### Hosted evals
|
|
97
|
-
|
|
98
|
-
Datasets, jobs, trials, checks, analyses and the `evolve` CLI are documented at https://docs.evolvingmachines.ai. The `evolve-evals` skill carries the same pages.
|
|
99
|
-
|
|
100
|
-
### Swarm & Pipeline
|
|
101
|
-
|
|
102
|
-
| Topic | Link |
|
|
103
|
-
|-------|------|
|
|
104
|
-
| Swarm setup (SwarmConfig) | [Swarm & Pipeline](./05-swarm-pipeline.md) |
|
|
105
|
-
| Input types (FileMap, folders, chaining) | [Swarm → Input Types](./05-swarm-pipeline.md#input-types) |
|
|
106
|
-
| `best_of()` (N candidates + judge) | [Swarm → best_of](./05-swarm-pipeline.md#best_of) |
|
|
107
|
-
| `map()` (parallel processing) | [Swarm → map](./05-swarm-pipeline.md#map) |
|
|
108
|
-
| `map()` + best_of | [Swarm → map + best_of](./05-swarm-pipeline.md#map--best_of) |
|
|
109
|
-
| `filter()` (evaluate + threshold) | [Swarm → filter](./05-swarm-pipeline.md#filter) |
|
|
110
|
-
| `reduce()` (synthesize many → one) | [Swarm → reduce](./05-swarm-pipeline.md#reduce) |
|
|
111
|
-
| `verify` (quality gate with feedback loop) | [Swarm → verify](./05-swarm-pipeline.md#verify-quality-gate) |
|
|
112
|
-
| Result types (SwarmResult, ReduceResult, BestOfResult) | [Swarm → Result Types](./05-swarm-pipeline.md#result-types) |
|
|
113
|
-
| Chaining operations (result.json → data.json) | [Swarm → Chaining Operations](./05-swarm-pipeline.md#chaining-operations) |
|
|
114
|
-
| AgentOverride (per-operation agent config — `AgentConfig` in Python) | [Swarm → AgentOverride](./05-swarm-pipeline.md#agentoverride) |
|
|
115
|
-
| Concurrency (semaphore, ordering guarantees) | [Swarm → Concurrency](./05-swarm-pipeline.md#concurrency) |
|
|
116
|
-
| RetryConfig (exponential backoff) | [Swarm & Pipeline](./05-swarm-pipeline.md) |
|
|
117
|
-
| Pipeline (fluent chaining) | [Swarm → Pipeline](./05-swarm-pipeline.md#pipeline) |
|
|
118
|
-
| Pipeline step configs (MapConfig, FilterConfig, ReduceConfig) | [Swarm → Step Configurations](./05-swarm-pipeline.md#step-configurations) |
|
|
119
|
-
| Pipeline events (step_start, step_complete, etc.) | [Swarm → Events](./05-swarm-pipeline.md#events) |
|
|
120
|
-
| Pipeline result (PipelineResult) | [Swarm → Result](./05-swarm-pipeline.md#result) |
|
|
121
|
-
| TerminalPipeline (reduce is terminal) | [Swarm → Terminal Pipeline](./05-swarm-pipeline.md#terminal-pipeline) |
|
|
122
|
-
| Filter `emit` option (success / filtered / all) | [Swarm → Pipeline](./05-swarm-pipeline.md#step-configurations) |
|
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
# Evolve TypeScript SDK
|
|
2
|
-
|
|
3
|
-
Run CLI agents ([Claude Code](https://github.com/anthropics/claude-code), [Codex](https://github.com/openai/codex), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Qwen Code](https://github.com/QwenLM/qwen-code), [Kimi Code](https://github.com/MoonshotAI/kimi-code), [OpenCode](https://github.com/anomalyco/opencode), [Droid](https://docs.factory.ai/cli/droid-exec/overview)) in secure sandboxes with built-in observability.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
**Requirements:** [Node.js 18+](https://nodejs.org/)
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @evolvingmachines/evolve
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Storage & checkpointing is available in [gateway mode](./03-runtime.md#storage--checkpointing) (`EVOLVE_API_KEY`) — no additional dependencies needed.
|
|
16
|
-
|
|
17
|
-
For structured output with [Zod](https://zod.dev) schemas (recommended but not required — JSON Schema objects also work):
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm install zod
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Quick Start
|
|
26
|
-
|
|
27
|
-
**1. Get your API key** from [dashboard.evolvingmachines.ai](https://dashboard.evolvingmachines.ai) — $10 free credits, no CC required.
|
|
28
|
-
|
|
29
|
-
**2. Set environment variables:**
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
# .env
|
|
33
|
-
EVOLVE_API_KEY=sk-... # Evolve gateway key (dashboard.evolvingmachines.ai)
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**3. Run your first agent:**
|
|
37
|
-
|
|
38
|
-
Evolve auto-resolves API keys and sandbox providers from environment variables — no need to pass them explicitly.
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
import { Evolve } from "@evolvingmachines/evolve";
|
|
42
|
-
|
|
43
|
-
const evolve = new Evolve()
|
|
44
|
-
.withSystemPrompt("You are Manus Evolve, a powerful AI agent. You can execute code, browse the web, manage files, and solve complex tasks.")
|
|
45
|
-
.withBrowser() // optional; defaults to remote managed agent-browser automation in Gateway mode
|
|
46
|
-
.withSkills(["anthropics/skills", "./my-skill"]) // skills.sh / git / local references
|
|
47
|
-
.withIntegrations({ userId: "root", apps: ["gmail", "notion"] }); // optional; managed integrations in Gateway mode
|
|
48
|
-
|
|
49
|
-
// Run agent
|
|
50
|
-
const result = await evolve.run({
|
|
51
|
-
prompt: "Go to Hacker News top posts. Spawn 5 parallel sub-agents to screenshot each of the top 5 posts."
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
console.log(result.stdout);
|
|
55
|
-
|
|
56
|
-
// Get output files
|
|
57
|
-
const output = await evolve.getOutputFiles();
|
|
58
|
-
for (const [name, content] of Object.entries(output.files)) {
|
|
59
|
-
console.log(name);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Once done, destroy sandbox
|
|
63
|
-
await evolve.kill();
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Core Lifecycle
|
|
67
|
-
|
|
68
|
-
Every Evolve application follows this pattern:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
new Evolve() → .run() → .getOutputFiles() → .kill()
|
|
72
|
-
setup execute retrieve results ALWAYS cleanup
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
> **IMPORTANT: Always call `kill()` when done.** Each `run()` creates a cloud sandbox that bills until destroyed. Forgetting `kill()` leaves sandboxes running indefinitely. Use try/finally to guarantee cleanup:
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
const evolve = new Evolve().withAgent({ type: "claude" });
|
|
79
|
-
try {
|
|
80
|
-
await evolve.run({ prompt: "Analyze the dataset" });
|
|
81
|
-
const output = await evolve.getOutputFiles();
|
|
82
|
-
console.log(output.files); // All files from output/
|
|
83
|
-
console.log(output.data); // Parsed result.json (if schema set)
|
|
84
|
-
} finally {
|
|
85
|
-
await evolve.kill(); // Always destroy sandbox
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
- `run()` can be called multiple times — each continues in the same sandbox session with full context/history.
|
|
90
|
-
- `getOutputFiles()` returns files from the `output/` folder. If `.withSchema()` was set, `output.data` contains the validated result.
|
|
91
|
-
- `kill()` destroys the sandbox. The next `run()` creates a fresh one.
|
|
92
|
-
|
|
93
|
-
### Streaming
|
|
94
|
-
|
|
95
|
-
Subscribe to real-time agent output:
|
|
96
|
-
|
|
97
|
-
```ts
|
|
98
|
-
evolve.on("content", (event) => {
|
|
99
|
-
// event.update.sessionUpdate: "agent_message_chunk" | "tool_call" | "plan" | ...
|
|
100
|
-
console.log(event.update);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
evolve.on("lifecycle", (event) => {
|
|
104
|
-
// event.reason: "sandbox_ready" | "run_complete" | "run_failed" | ...
|
|
105
|
-
console.log(event.reason, event.sandbox, event.agent);
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
See [Streaming Events](./04-streaming.md) for all event types, type definitions, and a full UI integration example.
|
|
110
|
-
|
|
111
|
-
### Gateway Features
|
|
112
|
-
|
|
113
|
-
When using `EVOLVE_API_KEY`:
|
|
114
|
-
|
|
115
|
-
- **Tracing:** Automatic tracing and agent analytics at [dashboard.evolvingmachines.ai](https://dashboard.evolvingmachines.ai) for observability and replay — no extra setup needed. Use `withSessionTagPrefix()` to label sessions for easy filtering.
|
|
116
|
-
- **Browser Automation:** Call `.withBrowser()` for the default and recommended managed browser path with dashboard live view and replay.
|
|
117
|
-
- **Checkpointing:** Snapshot sandbox state to Evolve-managed storage with `.withStorage()` — no S3 credentials needed. See [Storage & Checkpointing](./03-runtime.md#storage--checkpointing).
|
|
118
|
-
- **Hosted Evals:** Score agents against datasets of tasks on managed infrastructure with `jobs()` and `datasets()`, or the `evolve` CLI. See https://docs.evolvingmachines.ai.
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## Authentication
|
|
123
|
-
|
|
124
|
-
| | Gateway Mode | Managed BYO Provider Keys | Direct Provider Key Mode |
|
|
125
|
-
|---|---------|---------------------------|--------------------------|
|
|
126
|
-
| Setup | `EVOLVE_API_KEY` | `EVOLVE_API_KEY` + provider key saved in Dashboard → Secrets → BYO Provider Keys | [Model provider keys](#agent-reference) + [`E2B_API_KEY`](https://e2b.dev) |
|
|
127
|
-
| Provider key location | Evolve-managed | Encrypted Dashboard secret | Your local environment or app config |
|
|
128
|
-
| Sandbox receives | Evolve gateway runtime config | A short-lived, sandbox-scoped credential — never your raw provider key or `EVOLVE_API_KEY` for that route | Raw provider key environment variable |
|
|
129
|
-
| Observability | [dashboard.evolvingmachines.ai](https://dashboard.evolvingmachines.ai) | [dashboard.evolvingmachines.ai](https://dashboard.evolvingmachines.ai) | `~/.evolve-sdk/observability/` |
|
|
130
|
-
| Browser | `.withBrowser()` is the default and recommended managed browser path with live view and replay. | Same as Gateway Mode | Self-managed browser runtime; no managed live/replay |
|
|
131
|
-
| Model billing | Evolving Machines | Your provider account for enabled providers | Your provider accounts |
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
### Gateway Mode (EVOLVE_API_KEY)
|
|
136
|
-
|
|
137
|
-
Get API key from [dashboard.evolvingmachines.ai](https://dashboard.evolvingmachines.ai).
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
# .env
|
|
141
|
-
EVOLVE_API_KEY=sk-...
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
```ts
|
|
145
|
-
import { Evolve } from "@evolvingmachines/evolve";
|
|
146
|
-
|
|
147
|
-
const evolve = new Evolve()
|
|
148
|
-
.withAgent({ type: "claude" });
|
|
149
|
-
|
|
150
|
-
await evolve.run({ prompt: "Hello" });
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
### Managed BYO Provider Keys
|
|
156
|
-
|
|
157
|
-
Use this when you want supported provider usage billed to your provider account while keeping gateway features.
|
|
158
|
-
|
|
159
|
-
1. Save your provider key in Dashboard → Secrets → BYO Provider Keys.
|
|
160
|
-
2. Keep `EVOLVE_API_KEY` in your app.
|
|
161
|
-
3. Run any supported agent normally.
|
|
162
|
-
|
|
163
|
-
**You can save a key for Anthropic and OpenAI.** Those are the two providers this route serves today, so a Claude run or a Codex run can bill your own account. The gateway itself reaches seven providers — Anthropic, OpenAI, Gemini, DashScope, Kimi, OpenRouter, and Droid/Factory — but the other five have no bring-your-own path, and a run that routes through one of them is billed to Evolve whether or not you have a key saved. That is not a silent fallback so much as arithmetic: an Anthropic key cannot pay for a Moonshot call.
|
|
164
|
-
|
|
165
|
-
When enabled, Evolve routes supported provider calls through a short-lived, sandbox-scoped credential. The SDK does not receive the raw provider key, and the sandbox does not receive `EVOLVE_API_KEY` for that provider route. If no managed key is enabled for that provider, gateway mode falls back to Evolve-managed model routing.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
### Direct Provider Key Mode (Local BYOK)
|
|
170
|
-
|
|
171
|
-
Use this when you want to pass provider keys from your own local environment or app config. Requires [E2B API key](https://e2b.dev) for sandbox.
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
# .env
|
|
175
|
-
ANTHROPIC_API_KEY=sk-...
|
|
176
|
-
E2B_API_KEY=e2b_...
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
```ts
|
|
180
|
-
import { Evolve, createE2BProvider } from "@evolvingmachines/evolve";
|
|
181
|
-
|
|
182
|
-
const sandbox = createE2BProvider({
|
|
183
|
-
apiKey: process.env.E2B_API_KEY,
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
const evolve = new Evolve()
|
|
187
|
-
.withAgent({
|
|
188
|
-
type: "claude",
|
|
189
|
-
providerApiKey: process.env.ANTHROPIC_API_KEY,
|
|
190
|
-
})
|
|
191
|
-
.withSandbox(sandbox);
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### BYO Claude Max Subscription
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
# Run in terminal, follow login steps -> receive token:
|
|
198
|
-
claude --setup-token
|
|
199
|
-
|
|
200
|
-
# Long-lived authentication token created successfully!
|
|
201
|
-
# Your OAuth token (valid for 1 year): sk-ant-...
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
# .env
|
|
206
|
-
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-...
|
|
207
|
-
E2B_API_KEY=e2b_...
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
```ts
|
|
211
|
-
import { Evolve, createE2BProvider } from "@evolvingmachines/evolve";
|
|
212
|
-
|
|
213
|
-
const sandbox = createE2BProvider({
|
|
214
|
-
apiKey: process.env.E2B_API_KEY,
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
const evolve = new Evolve()
|
|
218
|
-
.withAgent({
|
|
219
|
-
type: "claude",
|
|
220
|
-
// SDK reads token from CLAUDE_CODE_OAUTH_TOKEN automatically
|
|
221
|
-
})
|
|
222
|
-
.withSandbox(sandbox);
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### BYO Codex Subscription
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
# Run in terminal, follow login steps:
|
|
229
|
-
codex auth --provider openai
|
|
230
|
-
|
|
231
|
-
# Creates auth file at ~/.codex/auth.json
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
# .env
|
|
236
|
-
CODEX_OAUTH_FILE_PATH=~/.codex/auth.json
|
|
237
|
-
E2B_API_KEY=e2b_...
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
```ts
|
|
241
|
-
import { Evolve, createE2BProvider } from "@evolvingmachines/evolve";
|
|
242
|
-
|
|
243
|
-
const sandbox = createE2BProvider({
|
|
244
|
-
apiKey: process.env.E2B_API_KEY,
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
const evolve = new Evolve()
|
|
248
|
-
.withAgent({
|
|
249
|
-
type: "codex",
|
|
250
|
-
// SDK reads auth file from CODEX_OAUTH_FILE_PATH automatically
|
|
251
|
-
})
|
|
252
|
-
.withSandbox(sandbox);
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### BYO Gemini Subscription
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
# Run in terminal, follow login steps:
|
|
259
|
-
gemini auth login
|
|
260
|
-
|
|
261
|
-
# Creates credentials file at ~/.gemini/oauth_creds.json
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
# .env
|
|
266
|
-
GEMINI_OAUTH_FILE_PATH=~/.gemini/oauth_creds.json
|
|
267
|
-
E2B_API_KEY=e2b_...
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
```ts
|
|
271
|
-
import { Evolve, createE2BProvider } from "@evolvingmachines/evolve";
|
|
272
|
-
|
|
273
|
-
const sandbox = createE2BProvider({
|
|
274
|
-
apiKey: process.env.E2B_API_KEY,
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
const evolve = new Evolve()
|
|
278
|
-
.withAgent({
|
|
279
|
-
type: "gemini",
|
|
280
|
-
// SDK reads credentials file from GEMINI_OAUTH_FILE_PATH automatically
|
|
281
|
-
})
|
|
282
|
-
.withSandbox(sandbox);
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
### Agent Reference
|
|
288
|
-
|
|
289
|
-
Set env vars and the SDK picks them up automatically — no need to pass explicitly.
|
|
290
|
-
|
|
291
|
-
> **IMPORTANT: Only use the exact model names listed below.** The SDK will error on unrecognized model names. Do not invent or guess model identifiers.
|
|
292
|
-
|
|
293
|
-
The Direct key column applies to Direct Provider Key Mode. Managed BYO Provider Keys use Gateway Mode plus Dashboard-stored provider keys.
|
|
294
|
-
|
|
295
|
-
| type | models | default | Gateway | Direct key |
|
|
296
|
-
|------|--------|---------|---------|------|
|
|
297
|
-
| `"claude"` | `"fable"` `"opus"` `"sonnet"` `"haiku"` `"opus[1m]"` `"sonnet[1m]"` `"glm-5.3"` `"glm-5.3-flash"` `"openrouter/deepseek/deepseek-v4.1-flash"` `"fireworks/deepseek-v4.1-flash"` | `"opus"` | `EVOLVE_API_KEY` | `ANTHROPIC_API_KEY` or `CLAUDE_CODE_OAUTH_TOKEN` |
|
|
298
|
-
| `"codex"` | `"gpt-5.6-sol"` `"gpt-5.6-terra"` `"gpt-5.6-luna"` `"gpt-5.5"` `"gpt-5.3-codex"` | `"gpt-5.6-sol"` | `EVOLVE_API_KEY` | `OPENAI_API_KEY` or `CODEX_OAUTH_FILE_PATH` |
|
|
299
|
-
| `"gemini"` | `"gemini-3.5-flash"` `"gemini-3.5-flash-lite"` `"gemini-3.1-pro-preview"` `"gemini-3.7-flash"` *(not selectable yet — see below)* | `"gemini-3.5-flash"` | `EVOLVE_API_KEY` | `GEMINI_API_KEY` or `GEMINI_OAUTH_FILE_PATH` |
|
|
300
|
-
| `"qwen"` | `"qwen3.7-max"` `"qwen3.7-plus"` `"qwen3.6-flash"` | `"qwen3.7-max"` | `EVOLVE_API_KEY` | `OPENAI_API_KEY` |
|
|
301
|
-
| `"kimi"` | `"kimi-k3"` `"kimi-k2.7-code"` `"kimi-k3-raptor"` `"kimi-k2p7-code-raptor"` | `"kimi-k3"` | `EVOLVE_API_KEY` | `KIMI_API_KEY` |
|
|
302
|
-
| `"opencode"` | `"openrouter/anthropic/claude-fable-5.1"` `"openrouter/anthropic/claude-opus-5"` `"openrouter/anthropic/claude-sonnet-5"` `"openrouter/anthropic/claude-haiku-4.5"` `"openrouter/openai/gpt-5.6-sol"` `"openrouter/openai/gpt-5.6-terra"` `"openrouter/openai/gpt-5.6-luna"` `"openrouter/google/gemini-3.6-flash"` `"openrouter/qwen/qwen3.7-max"` `"openrouter/moonshotai/kimi-k3"` `"openrouter/z-ai/glm-5.3"` `"openrouter/z-ai/glm-5.3-flash"` `"openrouter/deepseek/deepseek-v4.1-flash"` `"fireworks/deepseek-v4.1-flash"` | `"openrouter/anthropic/claude-opus-5"` | `EVOLVE_API_KEY` | `OPENROUTER_API_KEY` |
|
|
303
|
-
| `"droid"` | `"claude-fable-5.1"` `"claude-opus-5"` `"claude-sonnet-5"` `"claude-haiku-4-5"` `"gpt-5.6-sol"` `"gpt-5.6-terra"` `"gpt-5.6-luna"` `"gemini-3.6-flash"` `"qwen3.7-max"` `"kimi-k3"` `"glm-5.3"` `"glm-5.3-flash"` `"openrouter/deepseek/deepseek-v4.1-flash"` `"fireworks/deepseek-v4.1-flash"` | `"claude-opus-5"` | `EVOLVE_API_KEY` | `FACTORY_API_KEY` |
|
|
304
|
-
|
|
305
|
-
`"gemini-3.7-flash"` is named here for completeness: the gateway carries it as a correctly priced entry and serves it under its own name on a raw call. It is not selectable through the `gemini` agent, and nothing rejects it if you pass it anyway — the stable `gemini` CLI (0.55.1) rewrites the model client-side before the request ever leaves the sandbox, collapsing every name ending in `flash` onto its own current flash model. Ask for `"gemini-3.7-flash"` (or `"gemini-3.6-flash"`) today and you are silently served, and billed for, `gemini-3.5-flash`. Names that do not end in `flash` skip that rewrite, which is why `"gemini-3.5-flash-lite"` and `"gemini-3.1-pro-preview"` serve under their own names. A newer CLI release is not enough on its own, because the swap follows the CLI's own default flash, so a `-flash` name joins the selectable set only once a live probe shows the CLI actually serving it. On the hosted platform the wrong-model integrity guard refuses such a trial rather than scoring it; with your own provider key there is no backstop, so treat the three names above as the gemini lineup you can really run.
|
|
306
|
-
|
|
307
|
-
Model names route by themselves: pass just the name from the table and Evolve serves it on its default provider, or pass a provider-prefixed name (`openai/gpt-5.5`, `openrouter/moonshotai/kimi-k3`) to pick the provider explicitly. The table's names are the supported, priced set — prefixed routing beyond it works for advanced use but is outside the supported lineup. One agent differs: on "opencode" a prefixed name outside its table is sent as an OpenRouter id (`openrouter/<name>`), so pick a provider there through OpenRouter's own ids; the other agents pass a prefixed name through as written.
|
|
308
|
-
|
|
309
|
-
`"glm-5.3-flash"` is GLM-5.3 Flash served from one pinned Fireworks host through the gateway: $0.15/M input and $0.50/M output ($0.03/M cached input); `"glm-5.3"` is the full model on OpenRouter.
|
|
310
|
-
|
|
311
|
-
`"openrouter/deepseek/deepseek-v4.1-flash"` is DeepSeek V4.1 Flash served through OpenRouter, under the same spelling on `"claude"`, `"droid"` and `"opencode"`. The `openrouter/<vendor>/<model>` form is OpenRouter's own model id: the gateway routes any id in that form to OpenRouter and bills the call at OpenRouter's price for it, so other OpenRouter models work the same way — the table lists the supported ones. It is also the default model of the hosted evals analyzer (its default reasoning effort is `"high"`).
|
|
312
|
-
|
|
313
|
-
`"fireworks/deepseek-v4.1-flash"` is the same DeepSeek V4.1 Flash on a second route, served from Fireworks through the gateway, on the same three agents: $0.22/M input and $0.66/M output ($0.007/M cached input). Pick it when you want the Fireworks host; `"openrouter/deepseek/deepseek-v4.1-flash"` remains the default model of the hosted evals analyzer and task checker. It is served through the Evolve gateway; direct mode has no Fireworks key, so `"opencode"` with your own `OPENROUTER_API_KEY` refuses the name at configuration (`EvolveConfigError`, naming the model) instead of sending it.
|
|
314
|
-
|
|
315
|
-
Agent-specific option: `reasoningEffort` controls how much reasoning/thinking the selected agent uses when that agent supports it.
|
|
316
|
-
|
|
317
|
-
| Agent | Default when omitted (pinned by Evolve) | Supported `reasoningEffort` |
|
|
318
|
-
|-------|------------------------------------------|-----------------------------|
|
|
319
|
-
| `"claude"` | `"high"` — Claude Code's documented default | `"low"` `"medium"` `"high"` `"xhigh"` `"max"` |
|
|
320
|
-
| `"codex"` | `"high"` — pinned by Evolve (owner policy: graded harnesses run high) | `"none"` `"low"` `"medium"` `"high"` `"xhigh"` `"max"` (`"none"` and `"max"` are GPT-5.6 values) |
|
|
321
|
-
| `"gemini"` | No effort control | Not supported |
|
|
322
|
-
| `"qwen"` | `"thinking"` | `"thinking"` `"no-thinking"` |
|
|
323
|
-
| `"kimi"` | `"thinking"` at `"max"` effort — the Kimi K3 API default | `"thinking"` `"no-thinking"` `"low"` `"medium"` `"high"` `"xhigh"` `"max"` |
|
|
324
|
-
| `"opencode"` | `"thinking"` + `"high"` | `"thinking"` `"no-thinking"` `"minimal"` `"low"` `"medium"` `"high"` `"xhigh"` `"max"` |
|
|
325
|
-
| `"droid"` | `"high"` — matches Droid’s own default for Opus 5, pinned by Evolve | `"off"` `"minimal"` `"low"` `"medium"` `"high"` `"xhigh"` `"max"`; exact values depend on the Droid model |
|
|
326
|
-
|
|
327
|
-
When you omit `reasoningEffort`, Evolve does not leave the choice to the CLI. For every harness with an effort control, the SDK stamps the pinned default from the table explicitly on the run — as a flag, an environment variable, or a config-file entry, whatever that CLI reads. This keeps runs reproducible: the effort a run used is always recorded in the run itself, never implied by a vendor default that could change under you. Where the vendor documents a default, the pin matches it; `gemini` has no effort control, so nothing is stamped there.
|
|
328
|
-
|
|
329
|
-
Note that thinking cannot be disabled on Kimi K3 at the API level — `"no-thinking"` applies to the K2-generation models.
|
|
330
|
-
|
|
331
|
-
Agent-specific option: `config` supplies the harness's own native settings — a local file path or an inline object. Claude receives it as a settings JSON passed through `--settings`; Codex receives it as the base `~/.codex/config.toml` (an inline object must be losslessly representable as TOML — no `null` values). Your document is the base layer: Evolve's own inputs — gateway routing, MCP servers, the model and effort stamps — always land on top of it, so a config can tune permissions, sandbox settings, or tool behavior but never re-route where the model traffic goes. Only `claude` and `codex` support a native config; naming one on any other agent type throws at `.withAgent()` rather than being silently ignored.
|
|
332
|
-
|
|
333
|
-
```typescript
|
|
334
|
-
const evolve = new Evolve()
|
|
335
|
-
.withAgent({
|
|
336
|
-
type: "claude",
|
|
337
|
-
config: { permissions: { deny: ["WebSearch", "WebFetch"] } },
|
|
338
|
-
});
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
Instead of hand-writing such a config, `preset` names a bundle Evolve ships and guarantees. `preset: "no-internet"` turns off the vendor's server-side web tools — Claude gets that exact `permissions.deny` stamp, Codex gets `-c web_search=disabled` on its command line (Codex's default is `"cached"`, an OpenAI-maintained web index, so only the explicit flag removes the tool). `preset: "pinned-context"` pins one fixed effective context window (200000 tokens) — Claude via `autoCompactWindow`, Codex via `-c model_context_window` — so vendor-side window tuning never changes what a run had to work with. A preset is stamped **on top** of any `config` you also pass, and a preset stamp always wins where the two disagree: your document cannot undo the guarantee. Only `claude` and `codex` can guarantee the presets today; naming one on any other agent type throws at `.withAgent()` rather than running without its guarantee.
|
|
342
|
-
|
|
343
|
-
```typescript
|
|
344
|
-
const evolve = new Evolve()
|
|
345
|
-
.withAgent({ type: "codex", preset: "no-internet" });
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
For Claude Fable 5.1, use `model: "fable"`. For OpenCode via OpenRouter, use `model: "openrouter/anthropic/claude-fable-5.1"`. For Claude 1M context window, use `model: "sonnet[1m]"` or `model: "opus[1m]"`.
|
|
349
|
-
|
|
350
|
-
#### Harness and Model Pairing
|
|
351
|
-
|
|
352
|
-
A harness and its model are chosen together, and a few harnesses only accept models from their own family:
|
|
353
|
-
|
|
354
|
-
- **`qwen`** must run a Qwen-native model (the `qwen3.x` aliases, routed via DashScope). Qwen Code injects the DashScope-only `enable_thinking` request parameter on every call, which OpenAI-family models reject with a `400` — so pointing the `qwen` harness at a non-Qwen model fails.
|
|
355
|
-
- **`opencode`** routes every model through OpenRouter, so its models are the `openrouter/…` ids in the table above (a bare id is prefixed with `openrouter/` for you).
|
|
356
|
-
- **`kimi`** must be told a context ceiling, which Kimi Code sends as the request's `max_tokens`. Its own models get Kimi's 262144; any other model (say `gpt-5.5` behind an OpenAI-compatible gateway) gets a conservative 128000 instead, because an oversized `max_tokens` is rejected outright — LiteLLM answers `400 max_tokens is too large`. Pass the model's real ceiling to skip the guess:
|
|
357
|
-
|
|
358
|
-
```ts
|
|
359
|
-
.withAgent({
|
|
360
|
-
type: "kimi",
|
|
361
|
-
model: "gpt-5.5",
|
|
362
|
-
maxContextSize: 128000, // (optional) the model's real completion ceiling, used verbatim
|
|
363
|
-
})
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
`maxContextSize` is an SDK option, never an environment variable. Harnesses that do not send a ceiling ignore it.
|
|
367
|
-
|
|
368
|
-
Two harness quirks the SDK handles automatically, with nothing for you to set: the `claude` harness runs with `IS_SANDBOX=1` so Claude Code's `--dangerously-skip-permissions` is allowed under root, and the `gemini` harness boots with workspace trust set so Gemini CLI runs headless instead of refusing an untrusted workspace.
|
|
369
|
-
|
|
370
|
-
#### Evolve-Provided Gateway Models
|
|
371
|
-
|
|
372
|
-
These models require Gateway mode (`EVOLVE_API_KEY`) and are routed by Evolve for latency-sensitive runs. Direct provider keys do not apply.
|
|
373
|
-
|
|
374
|
-
| Agent | Model | Use |
|
|
375
|
-
|-------|-------|-----|
|
|
376
|
-
| `"kimi"` | `"kimi-k3-raptor"` | Kimi K3 fast route for latency-sensitive agent runs |
|
|
377
|
-
| `"kimi"` | `"kimi-k2p7-code-raptor"` | Kimi K2.7 Code Raptor route for interactive coding and agent runs |
|
|
378
|
-
|
|
379
|
-
### Agent Examples
|
|
380
|
-
|
|
381
|
-
```bash
|
|
382
|
-
# .env - set env vars for auto-pickup
|
|
383
|
-
ANTHROPIC_API_KEY=sk-... # claude
|
|
384
|
-
OPENAI_API_KEY=sk-... # codex, qwen
|
|
385
|
-
GEMINI_API_KEY=... # gemini
|
|
386
|
-
KIMI_API_KEY=... # kimi
|
|
387
|
-
OPENROUTER_API_KEY=sk-... # opencode
|
|
388
|
-
FACTORY_API_KEY=... # droid
|
|
389
|
-
E2B_API_KEY=e2b_... # sandbox
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
```ts
|
|
393
|
-
// claude (auto-picks ANTHROPIC_API_KEY + E2B_API_KEY)
|
|
394
|
-
const evolve = new Evolve()
|
|
395
|
-
.withAgent({ type: "claude" });
|
|
396
|
-
|
|
397
|
-
const evolve = new Evolve()
|
|
398
|
-
.withAgent({ type: "claude", model: "opus" });
|
|
399
|
-
|
|
400
|
-
const evolve = new Evolve()
|
|
401
|
-
.withAgent({ type: "claude", model: "fable" });
|
|
402
|
-
|
|
403
|
-
const evolve = new Evolve()
|
|
404
|
-
.withAgent({ type: "claude", reasoningEffort: "max" });
|
|
405
|
-
|
|
406
|
-
const evolve = new Evolve()
|
|
407
|
-
.withAgent({
|
|
408
|
-
type: "claude",
|
|
409
|
-
model: "sonnet[1m]", // 1M context window
|
|
410
|
-
});
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
```ts
|
|
414
|
-
// codex (auto-picks OPENAI_API_KEY + E2B_API_KEY)
|
|
415
|
-
const evolve = new Evolve()
|
|
416
|
-
.withAgent({ type: "codex" });
|
|
417
|
-
|
|
418
|
-
const evolve = new Evolve()
|
|
419
|
-
.withAgent({ type: "codex", model: "gpt-5.3-codex" });
|
|
420
|
-
|
|
421
|
-
const evolve = new Evolve()
|
|
422
|
-
.withAgent({ type: "codex", reasoningEffort: "high" });
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
```ts
|
|
426
|
-
// gemini (auto-picks GEMINI_API_KEY + E2B_API_KEY)
|
|
427
|
-
const evolve = new Evolve()
|
|
428
|
-
.withAgent({ type: "gemini" });
|
|
429
|
-
|
|
430
|
-
const evolve = new Evolve()
|
|
431
|
-
.withAgent({ type: "gemini", model: "gemini-3.1-pro-preview" });
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
```ts
|
|
435
|
-
// qwen (auto-picks OPENAI_API_KEY + E2B_API_KEY)
|
|
436
|
-
const evolve = new Evolve()
|
|
437
|
-
.withAgent({ type: "qwen" });
|
|
438
|
-
|
|
439
|
-
const evolve = new Evolve()
|
|
440
|
-
.withAgent({ type: "qwen", model: "qwen3.7-max" });
|
|
441
|
-
|
|
442
|
-
const evolve = new Evolve()
|
|
443
|
-
.withAgent({ type: "qwen", reasoningEffort: "no-thinking" });
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
```ts
|
|
447
|
-
// kimi (auto-picks KIMI_API_KEY + E2B_API_KEY)
|
|
448
|
-
const evolve = new Evolve()
|
|
449
|
-
.withAgent({ type: "kimi" });
|
|
450
|
-
|
|
451
|
-
const evolve = new Evolve()
|
|
452
|
-
.withAgent({ type: "kimi", model: "kimi-k3" });
|
|
453
|
-
|
|
454
|
-
const evolve = new Evolve()
|
|
455
|
-
.withAgent({
|
|
456
|
-
type: "kimi",
|
|
457
|
-
model: "kimi-k2p7-code-raptor",
|
|
458
|
-
reasoningEffort: "thinking",
|
|
459
|
-
});
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
```ts
|
|
463
|
-
// opencode — OpenRouter (auto-picks OPENROUTER_API_KEY + E2B_API_KEY)
|
|
464
|
-
const evolve = new Evolve()
|
|
465
|
-
.withAgent({ type: "opencode" });
|
|
466
|
-
|
|
467
|
-
const evolve = new Evolve()
|
|
468
|
-
.withAgent({ type: "opencode", model: "openrouter/openai/gpt-5.6-sol" });
|
|
469
|
-
|
|
470
|
-
const evolve = new Evolve()
|
|
471
|
-
.withAgent({ type: "opencode", model: "openrouter/anthropic/claude-fable-5.1" });
|
|
472
|
-
|
|
473
|
-
const evolve = new Evolve()
|
|
474
|
-
.withAgent({ type: "opencode", reasoningEffort: "xhigh" });
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
```ts
|
|
478
|
-
// droid (auto-picks FACTORY_API_KEY + E2B_API_KEY)
|
|
479
|
-
const evolve = new Evolve()
|
|
480
|
-
.withAgent({ type: "droid" });
|
|
481
|
-
|
|
482
|
-
const evolve = new Evolve()
|
|
483
|
-
.withAgent({ type: "droid", model: "gpt-5.5" });
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
---
|
|
487
|
-
|
|
488
|
-
## Where to go next
|
|
489
|
-
|
|
490
|
-
- [Configuration](./02-configuration.md) shapes the sandbox: which provider, which image, which skills, secrets and integrations.
|
|
491
|
-
- [Runtime](./03-runtime.md) covers everything after `run()` — files in and out, sessions, checkpointing, cost.
|
|
492
|
-
- [Streaming](./04-streaming.md) is the event surface a UI subscribes to.
|
|
493
|
-
- [Swarm & Pipeline](./05-swarm-pipeline.md) runs many agents in parallel and chains the results.
|
|
494
|
-
- [Hosted evals](https://docs.evolvingmachines.ai) is the other half of the SDK, and the part that is easiest to miss. Instead of driving one agent yourself, you hand Evolve datasets and a list of agents and read back scored trials — `jobs()` and `datasets()`, or the `evolve` CLI, with no `Evolve` instance involved. Start with `datasets().list()`: what comes back is whatever the platform has published to your account. If that list is empty, you have not hit a wall — [Bring your own dataset](https://docs.evolvingmachines.ai/core-concepts/datasets) publishes a corpus of your own.
|