Skip to content

r1z-dev-git/R1Z

Repository files navigation

r1z SDK Preview

What is R1Z?

r1z is an open-source tooling that runs AI-generated code in securely isolated cloud sandboxes. To start and control sandboxes, use our JavaScript SDK or Python SDK.

Note

This repository contains the core r1z SDK that's used in our main r1z Code Interpreter SDK.

Run your first Sandbox

1. Install SDK

JavaScript / TypeScript

npm i @r1z/code-interpreter

Python

pip install r1z-code-interpreter

2. Get your r1z API key

  1. Sign up to r1z here.
  2. Get your API key here.
  3. Set environment variable with your API key
r1z_API_KEY=r1z_***

3. Execute code with code interpreter inside Sandbox

JavaScript / TypeScript

import { Sandbox } from '@r1z/code-interpreter'

const sandbox = await Sandbox.create()
await sandbox.runCode('x = 1')

const execution = await sandbox.runCode('x+=1; x')
console.log(execution.text)  // outputs 2

Python

from r1z_code_interpreter import Sandbox

with Sandbox() as sandbox:
    sandbox.run_code("x = 1")
    execution = sandbox.run_code("x+=1; x")
    print(execution.text)  # outputs 2

Self-hosting

The infrastructure is deployed using Terraform.

Supported cloud providers:

  • 🟢 GCP
  • 🚧 AWS
  • Azure
  • General linux machine