Skip to content

Commit ce95922

Browse files
authored
doc(readme): typos and missing key in .env.template (#4)
* improve readme and scripts. * update e2b part. * update section on e2b. * remove local e2b * update the code and script. * remove e2b auth login.
1 parent a11bae2 commit ce95922

File tree

5 files changed

+57
-15
lines changed

5 files changed

+57
-15
lines changed

README.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,25 +178,49 @@ If you wish to use a different LLM as the primary agent model, you will need to
178178

179179
```bash
180180
## copy environment variable template and prepare yours in .env file
181+
cd miroflow/apps/prepare-benchmark
182+
cp .env.template .env
183+
vim .env
184+
cd miroflow/apps/run-agent
181185
cp .env.template .env
182186
vim .env
183187
```
184188

185-
**Step 3:** Prepare E2B Sandbox:
189+
**Step 3:** Prepare E2B Sandbox (Optional)
186190

187191
> [!TIP]
192+
> We provide a public E2B sandbox template. Follow this step if you want to reproduce.
193+
>
188194
> For the E2B sandbox service, we recommend setting up a Linux Docker image with a comprehensive set of apt and Python packages pre-installed. Without these pre-installed packages, the agent will need to spend extra steps and context installing them, resulting in reduced token efficiency.
195+
>
196+
> you need to have `npm` install and `docker` running locally.
197+
198+
199+
1. Install `e2b` command line and login:
189200

190-
1. Download our pre-configured Dockerfile:
201+
```shell
202+
## install e2b
203+
npm install -g @e2b/cli
204+
## check that it is available
205+
which e2b
206+
```
207+
208+
2. Download our pre-configured Dockerfile:
191209
[e2b.Dockerfile](https://github.com/MiroMindAI/MiroFlow/blob/main/docs/e2b.Dockerfile).
192210

193-
2. Run `e2b template build` command [check official doc here](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template), use `all_pip_apt_pkg` as the name of template.
211+
```shell
212+
wget https://github.com/MiroMindAI/MiroFlow/blob/main/docs/e2b.Dockerfile
213+
```
194214

195-
Command example:
196-
```shell
197-
E2B_ACCESS_TOKEN=${your-token}
198-
e2b template build -c "/root/.jupyter/start-up.sh" -t <team_id> -n all_pip_apt_pkg` -d ./e2b.Dockerfile
199-
```
215+
3. Run `e2b template build` command [check official doc here](https://e2b.dev/docs/sdk-reference/cli/v1.0.2/template), use `all_pip_apt_pkg` as the name of template.
216+
217+
```shell
218+
## build the template with `docker build` locally
219+
E2B_ACCESS_TOKEN=${your-token}
220+
e2b template build -c "/root/.jupyter/start-up.sh" -n "all_pip_apt_pkg" -d ./e2b.Dockerfile
221+
## check that template is built successfully
222+
E2B_ACCESS_TOKEN=${your-token} e2b template list
223+
```
200224

201225
For additional information, please see the [E2B Docker documentation](https://e2b.dev/docs/sandbox-template).
202226

@@ -218,7 +242,7 @@ Run prebuilt agent on the benchmark data:
218242
```bash
219243
## download data
220244
cd miroflow/apps/prepare-benchmark
221-
uv run python main.py get gaia-val
245+
uv run main.py get gaia-val
222246
## run the code
223247
cd miroflow/apps/run-agent
224248
uv run main.py common-benchmark benchmark=gaia-validation

apps/run-agent/.env.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ NEWAPI_API_KEY=""
2323
NEWAPI_BASE_URL=""
2424

2525
# use HTTPS proxy
26-
HTTPS_PROXY=""
26+
HTTPS_PROXY=""
27+
DATA_DIR="../../data"

apps/run-agent/scripts/claude-sonnet-3.7/run_evaluate_multiple_runs_gaia-validation.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ for i in $(seq 1 $NUM_RUNS); do
2525
RUN_ID="run_$i"
2626

2727
(
28-
uv run python benchmarks/common_benchmark.py \
28+
uv run main.py common-benchmark \
2929
benchmark=$BENCHMARK_NAME \
3030
llm=claude_openrouter \
3131
llm.provider=$LLM_PROVIDER \
@@ -35,7 +35,7 @@ for i in $(seq 1 $NUM_RUNS); do
3535
benchmark.execution.max_concurrent=5 \
3636
benchmark.execution.pass_at_k=1 \
3737
agent=$AGENT_SET \
38-
hydra.run.dir=${RESULTS_DIR}/$RUN_ID \
38+
output_dir="$RESULTS_DIR/$RUN_ID" \
3939
> "$RESULTS_DIR/${RUN_ID}_output.log" 2>&1
4040

4141
if [ $? -eq 0 ]; then
@@ -64,7 +64,7 @@ echo "All $NUM_RUNS runs completed!"
6464
echo "=========================================="
6565

6666
echo "Calculating average scores..."
67-
uv run python benchmarks/evaluators/calculate_average_score.py "$RESULTS_DIR"
67+
uv run main.py avg-score "$RESULTS_DIR"
6868

6969
echo "=========================================="
7070
echo "Multiple runs evaluation completed!"

docs/e2b.Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# You can use most Debian-based base images
2+
FROM e2bdev/code-interpreter
3+
4+
# Update package list and install Python 3.10 and pip
5+
RUN apt-get update && apt-get install -y \
6+
portaudio19-dev \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
10+
11+
# Install dependencies and customize sandbox
112
RUN python3 -m pip install --no-cache-dir \
213
Flask \
314
IPython \

libs/miroflow-tool/src/miroflow/tool/mcp_servers/python_server.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import asyncio
12
import os
23

34
from e2b_code_interpreter import Sandbox
45
from fastmcp import FastMCP
5-
import asyncio
66

77
# Initialize FastMCP server
88
mcp = FastMCP("e2b-python-interpreter")
@@ -11,6 +11,10 @@
1111
E2B_API_KEY = os.environ.get("E2B_API_KEY")
1212
LOGS_DIR = os.environ.get("LOGS_DIR") # Directory where benchmark logs are stored
1313

14+
# DEFAULT TEMPLATE ID
15+
# see README.md on how to build this
16+
DEFAULT_TEMPLATE_ID = "1av7fdjfvcparqo8efq6"
17+
1418
# DEFAULT CONFS
1519
DEFAULT_TIMEOUT = 1200 # seconds
1620

@@ -138,7 +142,9 @@ async def create_sandbox() -> str:
138142
sandbox = None
139143
try:
140144
sandbox = Sandbox(
141-
template="all_pip_apt_pkg", timeout=DEFAULT_TIMEOUT, api_key=E2B_API_KEY
145+
template=DEFAULT_TEMPLATE_ID,
146+
timeout=DEFAULT_TIMEOUT,
147+
api_key=E2B_API_KEY,
142148
)
143149
info = sandbox.get_info()
144150

0 commit comments

Comments
 (0)