Skip to content

spore-host/truffle

Repository files navigation

truffle

CI Go Report Card codecov Go Reference License: Apache 2.0 DOI

Find EC2 instance types, compare spot prices, check quotas.

All discovery commands require AWS credentials (configured via aws configure, environment variables, or IAM role). Only truffle app list and truffle version work without credentials.

Installation

macOS / Linux (Homebrew)

brew install spore-host/tap/truffle

Windows (Scoop)

scoop bucket add spore-host https://github.com/spore-host/scoop-bucket
scoop install truffle

Debian / Ubuntu

curl -LO https://github.com/spore-host/truffle/releases/latest/download/truffle_linux_amd64.deb
sudo dpkg -i truffle_linux_amd64.deb

RHEL / Fedora

sudo rpm -i https://github.com/spore-host/truffle/releases/latest/download/truffle_linux_amd64.rpm

Direct download — pre-built binaries for Linux, macOS, and Windows (amd64/arm64) on the releases page.

Build from source

git clone https://github.com/spore-host/truffle
cd truffle && make build && sudo make install

Quick Start

# Search instance types (glob or regex)
truffle search "m7i*"                         # glob: all m7i sizes
truffle search "c[6-8]i\.large"               # regex: c6i/c7i/c8i large

# Compare spot prices
truffle spot m7i.large --regions us-east-1 --show-savings
truffle spot "c6a*" --sort-by-price --lookback-hours 24

# Find by natural language
truffle find "h200 8gpu efa"
truffle find "amd turin 32 cores 64gb" --exact
truffle find graviton --regions us-east-1

# Check EC2 quotas
truffle quotas --regions us-east-1 --family P
truffle quotas --regions us-east-1 -o json

# Check SageMaker quotas
truffle quotas --service sagemaker --family g5 --regions us-west-2

# Discover SageMaker ml.* instance types (specs, pricing, managed-spot eligibility)
truffle find "ml.g5.*" --service sagemaker --regions us-east-1
truffle find "ml.g5.*" --service sagemaker --show-quota --regions us-east-1

# Find available capacity reservations
truffle capacity --gpu-only

# Output formats (all commands)
truffle search "m7i*" -o json
truffle find "intel 8 vcpu" -o csv

Commands

Command Description
search <pattern> Search by glob (m7i*) or regex (c[6-8]i\.large); --service sagemaker for ml.* types
find <query> Natural language search (amd epyc 32 cores 64gb); --service sagemaker for ml.* types
spot <pattern> Spot pricing with savings vs on-demand
az <pattern> AZ-first availability view
capacity On-demand capacity reservations (ODCRs)
capacity-blocks Discover purchasable EC2 Capacity Block for ML offerings
list List instance families or sizes
quotas EC2 and SageMaker service quotas
app list Browse application catalog (no credentials needed)
version Show version, build info, and project URL

Global Flags

Flag Description
-o, --output Output format: table, json, yaml, csv
-r, --regions Filter by regions (comma-separated)
--no-emoji Disable emoji in output
--no-color Disable colorized output
--lang Language: en, es, fr, de, ja, pt

Go Library

import "github.com/spore-host/truffle/pkg/aws"

client, _ := aws.NewClient(ctx)
results, _ := client.SearchInstanceTypes(ctx, regions, matcher, opts)

// On-demand rate for one type (live AWS Price List, cached)
rate, _ := client.HourlyRate(ctx, "c6i.4xlarge", "us-east-1", "on-demand")

// Spot prices with on-demand comparison populated
prices, _ := client.GetSpotPricing(ctx, results, aws.SpotOptions{ShowSavings: true})

Testing with awsmock

The aws.Finder interface allows downstream projects to mock truffle's discovery layer:

import (
    "github.com/spore-host/truffle/pkg/aws"
    "github.com/spore-host/truffle/pkg/aws/awsmock"
)

mock := awsmock.New(
    awsmock.WithRegions([]string{"us-east-1"}),
    awsmock.WithInstances([]aws.InstanceTypeResult{
        {InstanceType: "m7i.large", Region: "us-east-1", VCPUs: 2, MemoryMiB: 8192},
    }),
    awsmock.WithOnDemandPrices(map[string]float64{"m7i.large/us-east-1": 0.1008}),
)
// Use mock anywhere an aws.Finder is accepted.

Python

Use the spore-host SDK (pip install spore-host) for Python access — spore.truffle.find(...) wraps truffle's discovery via the hosted REST API.

(An earlier native-CGO binding experiment was never completed; its design notes live in docs/design/native-cgo-binding/ — not an installable package. See truffle#76.)

Documentation

Full reference at spore.host/docs.

License

Apache 2.0 — Copyright 2025-2026 Scott Friedman.

About

Find EC2 instance types, compare spot prices, check quotas

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors