oneshotlm
Compare all models on this prompt →

Boids flocking · llama-3.1-70b-instruct

Output generated Cost / run $0.0041 Runtime 37.4s

Prompt for this run

Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.

⛨ sandboxed Open in new tab ↗

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelllama-3.1-70b-instruct
vendorMeta · Llama
harnesspi-agent
generated2026-08-01

METRICS

runtime37.4s
tokens in9.2k
tokens out1.2k
cached0
cost / run$0.0041
Transcript · 8 messages
user

Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.

assistant
assistant
→ write [{"path":"/tmp/ws/index.html","content":"<!DOCTYPE html><html><head><style>body{margin:0;overflow:hidden;background-color:#333}canvas{displa
toolResult

Validation failed for tool "write": - root: must be object Received arguments: [ { "path": "/tmp/ws/index.html", "content": "<!DOCTYPE html><html><head><style>body{margin:0;overflow:hidden;background-color:#333}canvas{display:block}</style></head><body><canvas id=\"canvas\"></canvas><script>const canvas = document.getElementById(\"canvas", "x": "canvas.width / 2", "y": "canvas.height / 2", "velocityX": "Math.random() * 2 - 1", "velocityY": "Math.random() * 2 - 1]));function draw(){ctx.clearRect(0" }, { "x": "e.clientX,y: e.clientY};for (const boid of boids) {const distanceToMouse = Math.hypot(mouse.x - boid.x, mouse.y - boid.y);const angleToMouse = Math.atan2(mouse.y - boid.y, mouse.x - boid.x);const separationForce = 100 / (distanceToMouse + 10);boid.velocityX += separationForce * Math.cos(angleToMouse);boid.velocityY += separationForce * Math.sin(angleToMouse);}});</script></body></html>" } ]

assistant

It seems like I made an error. Let me try again. Here is the complete index.html file: ```

assistant
→ write /tmp/ws/index.html (1520 bytes)
toolResult

Successfully wrote 1520 bytes to /tmp/ws/index.html

assistant

A full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor has been created. The simulation is contained within a single self-contained file named index.html in the current directory.