Skip to main content

crunr

Run any compute job on a GPU — no DevOps required.

pip install crunr

crunr supports two backends. Switch with one command:

crunr use cloud   # → crunr cloud GPU  (no AWS account needed)
crunr use aws     # → your own AWS EC2  (default)

Once you've set a context, all commands (run, jobs, logs, pull, share, cancel, balance) automatically target the right backend.


Quick start — crunr cloud

The fastest way to run a GPU job. No AWS account, no instance management.

# 1. Get an API key at cloud.crunr.com → Dashboard → API Keys
crunr cloud login

# 2. Switch to cloud context
crunr use cloud

# 3. Run a job
crunr run train.py --gpu
crunr run train.py --instance a100 --max-hours 4

# 4. Check status
crunr jobs

# 5. Download outputs
crunr pull <JOB_ID>

Outputs are stored in crunr cloud storage. Download whenever you want — even days later.


Quick start — AWS EC2

Bring your own AWS account. You pay AWS directly, no markup.

# 1. Configure AWS credentials (one-time)
crunr auth

# 2. Switch to AWS context (default, skip if you haven't changed it)
crunr use aws

# 3. Run a job
crunr run train.py --gpu

# 4. Check history
crunr jobs

Templates

New to crunr? Start from a ready-to-run template instead of a blank script — works with either backend:

crunr templates ls                              # browse what's available
crunr templates show finetune-distilbert-agnews # description + suggested run command
crunr templates use finetune-distilbert-agnews  # copy it into ./finetune-distilbert-agnews/

cd finetune-distilbert-agnews
crunr run train.py --gpu --memory 16

crunr templates use <name> --dir PATH scaffolds into a custom directory instead, and --force overwrites files that already exist there.


Context system

crunr uses a persistent context so you don't have to type --cloud on every command.

crunr use cloud          # all commands now target crunr cloud
crunr use aws            # all commands now target AWS EC2

crunr run train.py       # goes to whichever context is active
crunr run train.py --cloud  # force cloud for this run only (any context)

Context is saved in ~/.crunr/config.json. The current context is shown on every command output.


crunr cloud commands

Command Description
crunr cloud login Save your crunr cloud API key
crunr run <script> Submit a job (cloud context)
crunr jobs List all your jobs, newest first
crunr logs <JOB_ID> Stream live logs
crunr pull <JOB_ID> Download outputs to local machine
crunr share <JOB_ID> Generate presigned download links (24h by default)
crunr cancel <JOB_ID> Cancel a queued or running job
crunr balance Show credit balance and storage usage
crunr cloud jobs --limit 50 Show more jobs
crunr share <JOB_ID> --ttl 1 1-hour links

crunr run options (cloud context)

script              Python/shell script to run
--instance GPU      GPU type: rtx4090 (default), a100, h100, rtx3090, rtx3080, rtx4080, …
--gpu               Request GPU (cheapest available)
--memory GB         Minimum GPU VRAM in GB
--max-hours N       Hard time limit in hours (default: 2). Job auto-stops at this limit.
--env KEY=VALUE     Environment variable passed to the job (repeatable)
--dir PATH          Local directory to sync (default: current directory)

GPU types

Type GPU VRAM
rtx3080 NVIDIA RTX 3080 10 GB
rtx3090 NVIDIA RTX 3090 24 GB
rtx4080 NVIDIA RTX 4080 16 GB
rtx4090 NVIDIA RTX 4090 24 GB
a100 NVIDIA A100 40–80 GB
h100 NVIDIA H100 80 GB

Storage

  • 25 GB free per account
  • $0.05/GB-month for overage
  • Outputs auto-expire 30 days after a run
  • Downloads are always free

Check usage anytime with crunr balance.

Credits

crunr cloud uses prepaid credits. 1 credit = $0.000001 USD. You only pay for GPU seconds used.

crunr balance                  # check credits
# Top up at cloud.crunr.com/dashboard/billing

AWS EC2 commands

Command Description
crunr auth Configure AWS credentials
crunr run <script> Provision EC2, run job, download outputs
crunr jobs Show local job history
crunr logs <JOB_ID> Show stdout log from S3
crunr pull <JOB_ID> Download outputs from S3
crunr share <JOB_ID> Generate presigned S3 download links
crunr ps List running EC2 instances
crunr clean Terminate all orphaned instances
crunr ssh Open a shell on a running instance
crunr s3 setup Create S3 bucket for output persistence
crunr s3 list List jobs stored in S3
crunr s3 pull <JOB_ID> Download a job from S3
crunr s3 status Show bucket usage and config
crunr s3 rm <JOB_ID> Delete a job from S3

crunr run options (aws context)

script              Python/shell script to run
--gpu               Request a GPU instance (cheapest available)
--memory GB         Minimum GPU VRAM or RAM in GB
--instance TYPE     Exact EC2 instance type (e.g. g5.xlarge)
--disk GB           Root EBS volume size (default: 8 GB CPU, 150 GB GPU)
--spot              Use spot pricing (cheaper, may be interrupted)
--env KEY=VALUE     Environment variable passed to the job (repeatable)
--dir PATH          Local directory to sync (default: current directory)
--profile NAME      AWS credential profile
--region REGION     Override AWS region

# S3 output persistence
--s3                Back up outputs using saved config (run 'crunr s3 setup' first)
--s3-bucket NAME    S3 bucket name (auto-created if needed)
--s3-prefix PREFIX  Key prefix (default: crunr-jobs)
--s3-no-local       Skip local download — outputs in S3 only
--s3-ttl DAYS       Auto-delete this job's S3 data after N days

Instance picker

If you pass an unknown --instance type, crunr shows a full table of available EC2 instances with GPU specs and pricing, and lets you pick interactively:

  ! Unknown EC2 instance type: rtx4090
  crunr cloud GPU types don't work in aws context.
  Switch to cloud:  crunr use cloud

  GPU instances
  #   Instance        GPU chip      GPUs × VRAM   vCPUs   RAM      ~$/hr
  ──────────────────────────────────────────────────────────────────────
  1   g4dn.xlarge     NVIDIA T4     1 × 16 GB     4       16 GB    $0.526
  ...

  Pick an instance [1–32]:

How AWS runs work

  1. Provision — selects the cheapest matching spot instance (falls back to on-demand)
  2. Sync — uploads your local directory (rsync or scp+tar)
  3. Execute — runs your command with live log streaming
  4. Collect — downloads outputs/ back to your machine
  5. Terminate — instance always destroyed, even on Ctrl+C or crash

Saving outputs (AWS)

Write files to an outputs/ directory and crunr downloads it automatically:

import os
os.makedirs("outputs", exist_ok=True)
with open("outputs/result.txt", "w") as f:
    f.write("done")

S3 output persistence

With S3 enabled, the EC2 instance pushes outputs to S3 before the instance terminates. Your results survive network failures and client disconnects.

crunr s3 setup --bucket crunr-yourname-outputs   # one-time setup
crunr run train.py --gpu --s3                     # run with S3 backup
crunr s3 pull <JOB_ID>                           # recover after disconnect

AWS IAM permissions

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "RunrVerify",
      "Effect": "Allow",
      "Action": ["sts:GetCallerIdentity"],
      "Resource": "*"
    },
    {
      "Sid": "RunrDescribe",
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstances", "ec2:DescribeImages", "ec2:DescribeKeyPairs",
        "ec2:DescribeSecurityGroups", "ec2:DescribeSpotPriceHistory",
        "ec2:DescribeAvailabilityZones", "ec2:DescribeVpcs",
        "ec2:DescribeSubnets", "ec2:DescribeInstanceTypes", "ec2:DescribeInstanceStatus"
      ],
      "Resource": "*"
    },
    {
      "Sid": "RunrInstances",
      "Effect": "Allow",
      "Action": [
        "ec2:CreateKeyPair", "ec2:DeleteKeyPair",
        "ec2:CreateSecurityGroup", "ec2:AuthorizeSecurityGroupIngress",
        "ec2:RunInstances", "ec2:TerminateInstances", "ec2:CreateTags",
        "ec2:RequestSpotInstances", "ec2:DescribeSpotInstanceRequests",
        "ec2:CancelSpotInstanceRequests"
      ],
      "Resource": "*"
    },
    {
      "Sid": "CrunrS3Bucket",
      "Effect": "Allow",
      "Action": [
        "s3:CreateBucket", "s3:ListBucket", "s3:GetBucketLocation",
        "s3:PutBucketPublicAccessBlock", "s3:PutBucketPolicy",
        "s3:PutEncryptionConfiguration", "s3:PutBucketOwnershipControls",
        "s3:PutLifecycleConfiguration", "s3:GetLifecycleConfiguration"
      ],
      "Resource": "arn:aws:s3:::crunr-*"
    },
    {
      "Sid": "CrunrS3Objects",
      "Effect": "Allow",
      "Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"],
      "Resource": "arn:aws:s3:::crunr-*/*"
    },
    {
      "Sid": "CrunrIAMRole",
      "Effect": "Allow",
      "Action": [
        "iam:CreateRole", "iam:GetRole", "iam:PutRolePolicy",
        "iam:GetRolePolicy", "iam:DeleteRolePolicy", "iam:DeleteRole", "iam:TagRole"
      ],
      "Resource": "arn:aws:iam::*:role/crunr-s3-writer"
    },
    {
      "Sid": "CrunrIAMProfile",
      "Effect": "Allow",
      "Action": [
        "iam:CreateInstanceProfile", "iam:GetInstanceProfile",
        "iam:AddRoleToInstanceProfile", "iam:RemoveRoleFromInstanceProfile",
        "iam:DeleteInstanceProfile", "iam:TagInstanceProfile"
      ],
      "Resource": "arn:aws:iam::*:instance-profile/crunr-instance-profile"
    },
    {
      "Sid": "CrunrPassRole",
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::*:role/crunr-s3-writer",
      "Condition": {
        "StringEquals": {"iam:PassedToService": "ec2.amazonaws.com"}
      }
    }
  ]
}

The S3, IAM, and PassRole blocks are only needed if you use --s3.


Requirements

  • Python 3.10+
  • For AWS context: an AWS account with appropriate IAM permissions
  • For cloud context: a crunr account at cloud.crunr.com

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crunr-2.5.0.tar.gz (95.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crunr-2.5.0-py3-none-any.whl (101.9 kB view details)

Uploaded Python 3

File details

Details for the file crunr-2.5.0.tar.gz.

File metadata

  • Download URL: crunr-2.5.0.tar.gz
  • Upload date:
  • Size: 95.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for crunr-2.5.0.tar.gz
Algorithm Hash digest
SHA256 f1343838cc98ced77ed33c4d96e94e98288c6e6d6aaec4fbffdc74df0c32e754
MD5 190b2c59c2c9693e228af5f328375a42
BLAKE2b-256 4886fe208f0dc0d96366197758767271720e2ca099b880a6ad09b80cda31cbb3

See more details on using hashes here.

File details

Details for the file crunr-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: crunr-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 101.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for crunr-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c9dc0ac6ff4b1eb36ee287399b8d6a82c5c125a15628ac08646fe1864cec946
MD5 d62c87c1bc094fbae330c5d5f7aef015
BLAKE2b-256 0231696faca677128a24633e3ce391b4c18839ee0cb7cda93b974fa772c610ad

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 files

2.4.1

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page