Archil: The serverless runtime for intelligence

Archil

3 min read Original article ↗

// Install: ai@7 disk @archildata/ai-sdk

// Set ARCHIL_API_KEY, ARCHIL_REGION, and AI_GATEWAY_API_KEY.

import { generateText, isStepCount } from "ai";

import * as archil from "disk";

import { createDiskTools } from "@archildata/ai-sdk";

const { disk: agentDisk } = await archil.createDisk({ name: "agent-workspace" });

// Give the agent your whole filesystem as tools

await generateText({

model: "anthropic/claude-sonnet-4.6",

prompt: "Write a short story, format it nicely and save it as story.pdf",

tools: createDiskTools(agentDisk),

stopWhen: isStepCount(30),

});

// Read the saved file after the agent finishes

const story = await agentDisk.getObject("story.pdf");

import * as archil from "disk";

const { disk } = await archil.createDisk({ name: "analytics" });

// Call 1: write a small CSV to the disk

await disk.exec("printf 'region,revenue\\nwest,120\\neast,95\\nwest,80\\n' > /mnt/archil/sales.csv");

// Call 2: a fresh microVM summarizes it with stdlib Python

const { stdout } = await disk.exec(`python3 - <<'EOF'

import csv

from collections import Counter

totals = Counter()

for row in csv.DictReader(open("/mnt/archil/sales.csv")):

totals[row["region"]] += int(row["revenue"])

print(dict(totals))

EOF`);

// Example stdout: {'west': 200, 'east': 95}

import * as archil from "disk";

// Prerequisites: ARCHIL_API_KEY in your CI secrets, an existing disk,

// and a repository the exec microVM can clone. Steps run for up to 5 min.

const disk = await archil.getDisk("dsk-abc123");

const checkout = `/mnt/archil/build-${crypto.randomUUID()}`;

// Step 1: clone and build in a fresh microVM

const build = await disk.exec(

`git clone https://github.com/your-org/app.git ${checkout} && cd ${checkout} && npm ci && npm run build`

);

if (build.exitCode !== 0) throw new Error(build.stderr);

// Step 2: a later step tests the same checkout, already on the disk

const test = await disk.exec(`cd ${checkout} && npm test`);

if (test.exitCode !== 0) throw new Error(test.stderr);

# Prerequisite: an existing disk, "training-data", that already holds

# your dataset, and a mount token for that disk.

# On your own GPU host: install the client

curl -s https://archil.com/install | sh

# Mount the dataset read-only

sudo mkdir -p /mnt/training-data

export ARCHIL_MOUNT_TOKEN="<disk-token>"

sudo --preserve-env=ARCHIL_MOUNT_TOKEN archil mount myorg/training-data /mnt/training-data \

--region aws-us-east-1 --read-only

# Your training job reads it like any local directory

ls /mnt/training-data

A disk for every tenant, agent, and job.

Create a disk for each customer, agent session, legal matter, or CI job. One account holds millions of disks, and creating one takes 9.3 ms, so new storage is one more API call.

Everything agents need to work with real data.

One file system, from prototype to petabytes.

Run here. Work from anywhere.

Archil runs tool calls and sandboxes beside a durable, shared filesystem. Your servers and applications work on the same files: a write is durable once fsync returns, and the next client to open the file reads it.

Inside Archil, serverless tool calls and persistent sandboxes run beside one durable shared filesystem. A request starts a tool call that runs python report.py, writes reports/report.pdf, and exits. One of your servers, connected over POSIX, runs python eval.py and adds reports/results.csv. Your application, connected over the S3 API, reads both files. The files stay on the filesystem after the tool call finishes.

Local-disk speed, S3 economics.

Archil keeps hot data on SSD and cold data in object storage. Connect an existing S3 bucket, or start with managed storage. With your own bucket, every file is an ordinary S3 object that any S3 tool can read without Archil.

Faster package installs

npm ci, 598 packages: 7.6 s on Archil, 86.3 s on Amazon EFS

11×

Faster small reads

4 KiB cache-miss read: 0.5 ms on Archil, typically 10 to 30 ms from S3

20×

Every benchmark uses only the public API, the released CLI, and standard tools like fio, git, and npm, and the published results include the tests we lost.

Teams build on Archil so they can stop building storage.

Works with the stack you already run.

Mount a disk wherever your code runs, on top of the bucket you already have.

  • Agents & frameworks

  • Sandboxes & serverless

  • Buckets

  • Databases

  • Infrastructure