Skip to main content

Get Started

1

First Install

npm install buildfunctions
Mojo coming soon! 🔥
2

Create an API token

3

Authenticate

Write your agent app code and authenticate with the Buildfunctions SDK:
JavaScript
...
const apiToken = process.env.BUILDFUNCTIONS_API_TOKEN
if (!apiToken) {
  return new NextResponse('Missing BUILDFUNCTIONS_API_TOKEN', { status: 500 })
}

// Authenticate with a Buildfunctions API token
await Buildfunctions({ apiToken })
...
4

Create a GPU Sandbox and run inference

JavaScript
...
// Create a GPU Sandbox with Python and PyTorch
const sandbox = await GPUSandbox.create({
  name: 'secure-agent-action',
  memory: '50000MB',
  gpu: 'T4',
  timeout: 1200, // 24 hours max
  language: 'python', // language available within sandbox
  code: inferenceCode, // inline code or path to file
  requirements: ['transformers', 'torch', 'accelerate'], // python dependencies
  model: '/home/prod/Qwen/Qwen3-8B', // path to folder with models can be local or remote (e.g., Hugging Face)
})

// Run inference within hardware-isolated VM (full GPU access)
const result = await sandbox.run()
...

Buildfunctions is currently in its beta stage. If you encounter any issues or have specific syntax requirements, please reach out and contact us, and we’ll work to address them.