Skip to content

Repository files navigation

neomesh

Unified GPU price discovery and intelligent routing across neocloud providers.

Stop overpaying for GPUs. Neomesh aggregates real-time pricing from multiple GPU cloud providers and routes you to the best option based on your priorities — cheapest, most reliable, or ready right now.

$ neomesh prices --gpu H100 --strategy cheapest

 Provider   │ Region    │ GPU   │ $/hr  │ Available │ Spot
────────────┼───────────┼───────┼───────┼───────────┼──────
 Vast.ai    │ us-east   │ H100  │ $1.10 │ ✓         │ ✓
 Vast.ai    │ eu-west   │ H100  │ $1.35 │ ✓         │ ✓
 Vast.ai    │ us-west   │ H100  │ $2.80 │ ✓         │ ✗

 ✓ Winner: Vast.ai us-east — $1.10/hr (saving $1.70 vs priciest)

Why neomesh?

GPU pricing across neocloud providers is fragmented. Each provider has its own API, its own pricing model, and its own availability quirks. Neomesh gives you:

  • One CLI to query all providers at once
  • Smart routing that picks the best option for your workload
  • Real-time pricing with TTL-based caching to avoid stale quotes
  • Resilient querying — if one provider is down, you still get results from the rest

Quickstart

Prerequisites

  • Rust 1.75+ (rustup update stable)
  • Linux / macOS / WSL

Or use the Nix development environment:

nix develop

Install and run

git clone https://github.com/azizadx/neomesh.git
cd neomesh

# Set your provider API keys
export NEOMESH_VASTAI_KEY="your_vastai_key"

# Find the cheapest H100
cargo run -p neomesh-cli -- prices --gpu H100 --count 1 --strategy cheapest

CLI Usage

neomesh prices [OPTIONS]

Options

Flag Description Default
--gpu GPU type filter (substring match) any
--count Minimum GPU count 1
--strategy Routing strategy (see below) cheapest

Routing strategies

Strategy Behavior
cheapest Lowest $/hr across all providers
readynow Only instances available now, then cheapest among those
reliable On-demand only (filters out spot), then cheapest
spot Spot/preemptible only, then cheapest

Examples

# Cheapest available A100
neomesh prices --gpu A100 --strategy readynow

# Multi-GPU spot instances
neomesh prices --gpu H100 --count 4 --strategy spot

# On-demand only for long-running training
neomesh prices --gpu A100-80GB --strategy reliable

# Debug logging
RUST_LOG=debug neomesh prices --gpu H100

Environment Variables

Variable Required Description
NEOMESH_VASTAI_KEY Yes Vast.ai API key
NEOMESH_RUNPOD_KEY Planned RunPod API key
RUST_LOG No Log level (info, debug, neomesh_adapters=debug)

Copy .env.example to .env and fill in your keys.

Architecture

neomesh/
├── crates/
│   ├── neomesh-core/       # Types, routing engine, price engine
│   ├── neomesh-adapters/   # Provider API clients
│   └── neomesh-cli/        # Command-line interface
├── docs/                   # Milestone-driven learning path
└── .forgejo/workflows/     # CI pipeline

Crate dependency graph

neomesh-cli → neomesh-adapters → neomesh-core
Crate Role
neomesh-core Zero-dependency foundation. Defines ProviderPrice, Strategy, Router, PriceEngine, and error types. No HTTP, no provider specifics.
neomesh-adapters Translates provider APIs into the unified ProviderPrice format. Each adapter implements the ProviderAdapter trait.
neomesh-cli User-facing CLI. Parses args, wires adapters into the price engine, displays results.

How it works

  1. The CLI parses your query (GPU type, count, strategy)
  2. PriceEngine fans out concurrent requests to all configured adapters
  3. Each adapter calls its provider API and normalizes results into ProviderPrice structs
  4. Router::pick() applies the selected strategy to filter and rank offers
  5. The winning RoutingDecision is displayed with savings metadata

Key abstractions

// Every adapter implements this trait
pub trait ProviderAdapter: Send + Sync {
    fn name(&self) -> &'static str;
    async fn get_prices(&self, gpu_type: &str, gpu_count: u32)
        -> Result<Vec<ProviderPrice>, NeomeshError>;
}
// The router selects the best offer based on strategy
let decision = Router::pick(&prices, Strategy::Cheapest)?;
println!("Winner: {} at ${}/hr", decision.winner.provider, decision.winner.price_per_hour);

Supported Providers

Provider Status Notes
Vast.ai Implemented Spot instances, verified availability
RunPod Planned Next adapter in the pipeline
Lambda Planned

Adding a new provider? Implement the ProviderAdapter trait in neomesh-adapters — see vastai.rs for reference.

Development

Build and test

cargo build
cargo test --workspace

Lint and format

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings

Using Nix

The project includes a Nix flake with all dependencies pre-configured:

nix develop

# Run all CI checks locally
check-all      # fmt + clippy + tests
check-fmt      # format check only
check-clippy   # lint only
check-test     # tests only

Tech Stack

Category Choice
Language Rust (edition 2024)
Async runtime Tokio
HTTP client reqwest (rustls)
CLI framework clap (derive)
Serialization serde + serde_json
Error handling thiserror
Logging tracing + tracing-subscriber
Testing wiremock (HTTP mocking)
CI GitHub Actions + Forgejo

Contributing

See CONTRIBUTING.md.

License

MIT

About

Unified GPU price discovery and intelligent routing across neocloud providers.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages