Skip to main content

Minimal config

tinfoil-config.yml
cvm-version: "<CVM_VERSION>" # TODO: Use latest version from https://github.com/tinfoilsh/cvmimage
cpus: 2
memory: 8192

containers:
  - name: "api"
    image: "ghcr.io/myorg/api-server:v1.0.0@sha256:abc123..."
    command: ["--port", "8000"]

shim:
  upstream-port: 8000
  paths:
    - /health
    - /api/*

With environment variables and secrets

tinfoil-config.yml
cvm-version: "<CVM_VERSION>" # TODO: Use latest version from https://github.com/tinfoilsh/cvmimage
cpus: 4
memory: 16384

containers:
  - name: "api"
    image: "ghcr.io/myorg/api-server:v2.1.0@sha256:def456..."
    env:
      - PORT: "8080"
      - LOG_LEVEL: "info"
      - NODE_ENV: "production"
    secrets:
      - DATABASE_URL
      - STRIPE_SECRET_KEY
    command: ["--port", "8080"]

shim:
  upstream-port: 8080
  paths:
    - /health
    - /api/*
    - /webhooks/*

With outbound network access

tinfoil-config.yml
cvm-version: "<CVM_VERSION>" # TODO: Use latest version from https://github.com/tinfoilsh/cvmimage
cpus: 4
memory: 16384

networks:
  backend:
    egress: allowlist
    allow:
      - api.stripe.com

containers:
  - name: "api"
    image: "ghcr.io/myorg/api-server:v2.1.0@sha256:def456..."
    networks: [backend]
    secrets:
      - STRIPE_SECRET_KEY
    command: ["--port", "8080"]

shim:
  upstream-port: 8080
  paths:
    - /api/*

GPU inference server (vLLM)

tinfoil-config.yml
cvm-version: "<CVM_VERSION>" # TODO: Use latest version from https://github.com/tinfoilsh/cvmimage
cpus: 16
memory: 65536
gpus: 1

models:
  - name: "gemma-4-31b-it"
    repo: "google/gemma-4-31B-it@419b2efe421994fdfd3394e621983d4cc511cd4f"
    mpk: "0900ca6b913db0036792149d3ea5862986d66a6964b010e998f56fbb7e1276ab_62578683904_59fe9787-ed93-577a-9fd9-a7804c932a11"

containers:
  - name: "inference"
    image: "vllm/vllm-openai:v0.14.1@sha256:6fc52be4609fc19b09c163be2556976447cc844b8d0d817f19bc9e1f44b48d5a"
    runtime: nvidia
    gpus: all
    ipc: host
    command: [
      "--model", "/tinfoil/mpk/mpk-0900ca6b913db0036792149d3ea5862986d66a6964b010e998f56fbb7e1276ab",
      "--served-model-name", "gemma-4-31b-it",
      "--port", "8001"
    ]

shim:
  upstream-port: 8001
  paths:
    - /v1/chat/completions
    - /v1/completions
    - /health
    - /metrics

Multi-container setup

tinfoil-config.yml
cvm-version: "<CVM_VERSION>" # TODO: Use latest version from https://github.com/tinfoilsh/cvmimage
cpus: 8
memory: 32768

containers:
  - name: "api"
    image: "ghcr.io/myorg/api-server:v1.0.0@sha256:abc123..."
    env:
      - PORT: "8080"
    secrets:
      - DATABASE_URL
    command: ["--port", "8080"]
  - name: "worker"
    image: "ghcr.io/myorg/worker:v1.0.0@sha256:def456..."
    env:
      - QUEUE_URL: "redis://localhost:6379"
    secrets:
      - API_SECRET

shim:
  upstream-port: 8080
  paths:
    - /health
    - /api/*