Your Mac is idle 18 hours a day. Let it do something useful.
Turn your idle Mac or GPU into a free public AI API.
Your Mac is asleep 18 hours a day.
Why not let it serve AI while you're away?
LlamaNet turns any idle Mac or GPU into a public OpenAI-compatible API.
One command. 60 seconds. Zero config.
Get a public URL. Run your own models. Let friends, apps, or AI agents use your machine.
curl -sSL https://llamanet.app/install.sh | sh
llamanet run hf.co/mistralai/Ministral-3-8B-Instruct-GGUF:Q4_K_M
That's it. Your Mac is now an AI server.
- Your hardware is underutilized. Apple Silicon has a Neural Engine, 16-core GPU, and unified memory β and most of the time it's rendering Finder windows.
- AI APIs are expensive. GPT-4 costs $30/M tokens. You can run an equivalent model on your Mac for the cost of electricity.
- Open-source models are good enough. Mistral, Qwen, Llama, Gemma β they run locally, they're fast, and they're free.
- Sharing is the hard part. LlamaNet handles that: tunnels, routing, discovery, load balancing. You just run the model.
# macOS / Linux
curl -sSL https://llamanet.app/install.sh | sh
# Windows (PowerShell)
irm https://llamanet.app/install.ps1 | iexThe installer:
- Detects or installs Python 3.9+
- Creates an isolated venv at
~/.llamanet/venv - Installs LlamaNet and llama-cpp-python
- Creates a
llamanetCLI launcher and Desktop shortcut - Auto-joins the public network at llamanet.app
Then run:
llamanet- Open http://localhost:8000 β the Model Manager opens automatically
- Search for a GGUF model (e.g.
qwen,llama,mistral) - Click Download β progress streams in real time
- Click Use β the model hot-loads and your node joins the network
You can also pre-load a model at startup:
llamanet run hf.co/mistralai/Ministral-3-8B-Instruct-GGUF:Q4_K_MOr install via PyPI:
pip install llamanet
llamanet run hf.co/mistralai/Ministral-3-8B-Instruct-GGUF:Q4_K_MModels can be switched at any time via the Web UI without restarting the node.
# macOS / Linux
curl -sSL https://llamanet.app/uninstall.sh | sh
# Windows (PowerShell)
irm https://llamanet.app/uninstall.ps1 | ieximport openai
client = openai.OpenAI(
base_url="https://llamanet.app/v1",
api_key="your-api-key"
)
response = client.chat.completions.create(
model="Ministral-3-8B-Instruct",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Get a free API key at llamanet.app.
You Your friend
βββ βββββββββββ
llamanet run \ client = openai.OpenAI(
hf.co/user/Model:Q4_K_M base_url="https://llamanet.app/v1",
api_key="ln-xxx"
β )
βΌ β
βββββββββββββββββββββββββββββββββββββββββββββββ
β llamanet.app (Gateway) β
β β
β Node Registry Β· Request Router Β· Auth β
β Real-time SSE Β· Model Discovery β
βββββββββββββββββββββββββββββββββββββββββββββββ
- You run the one-liner installer β
llamanetβ node auto-joinsllamanet.app - You download a model via the Web UI Model Manager
- Your node gets a Cloudflare tunnel URL (public, HTTPS) β zero config
- Anyone calls
llamanet.app/v1/chat/completionswith an API key - Gateway routes to the best available node
No Docker. No Kubernetes. No port forwarding. Just a tunnel and a registry.
- No-Model Mode β Start your node instantly, download models later via the Web UI
- Hot Reload β Switch models without restarting your node β download, select, done
- OpenAI-Compatible API β Drop-in replacement for any OpenAI client
- Free Public URLs β Automatic Cloudflare tunnels, zero config
- Web UI β Built-in model manager, chat interface, and network dashboard at
localhost:8000 - Model Manager β Search Hugging Face, download GGUF models with real-time progress, switch models without restarting
- Model Discovery β Search and connect to models across the network
- Reasoning Support β DeepSeek-R1, Qwen reasoning models with streaming reasoning content
- Gateway Routing β Central gateway with automatic node discovery and load balancing
- Real-time Network β SSE-powered live updates for node status, model availability, and metrics
- GPU Auto-detect β NVIDIA, Apple Silicon, CPU fallback
LlamaNet supports loading multiple models simultaneously in a pool with automatic LRU (Least Recently Used) eviction. This lets you:
- Instant model switching β switch between loaded models without reload time
- Memory-aware capacity β auto-detects how many models fit in your RAM/VRAM
- LRU eviction β when pool is full, the least recently used model is evicted to make room
| Variable | Default | Description |
|---|---|---|
MAX_MODELS |
0 (auto) |
Max models in memory (0 = auto-detect from RAM) |
MEMORY_BUDGET_GB |
0 (auto) |
Max RAM for models (0 = auto-detect) |
- First model loads normally on startup (or via Web UI)
- Loading a second model adds it to the pool (if capacity allows)
- When pool is full, the least recently used model is evicted
- Switching between pool models is instant β no reload overlay
- Pool state persists across restarts via
~/.llamanet/pool_history.json
| Tier | Model | Size (Q4_K_M) | Min RAM | Best For |
|---|---|---|---|---|
| Tiny | Phi-4 Mini | ~1.5 GB | 8 GB | Quick tasks, edge devices, fast iteration |
| Fast | Qwen 4B | ~2.5 GB | 8 GB | Daily driver β fast responses, solid quality |
| Standard | Ministral 3 8B | ~4.5 GB | 16 GB | Best all-round balance of speed and quality |
| Versatile | Gemma 3 12B | ~7 GB | 24 GB | General-purpose, multilingual, strong reasoning |
| Coding | Qwen 14B | ~8 GB | 32 GB | Code generation, technical tasks |
| Premium | GPT-OSS 20B | ~12 GB | 32 GB | High-quality general-purpose inference |
| High Quality | Qwen 35B-A3B | ~20 GB | 48 GB | Expert-level reasoning, long-form generation |
| Reasoning | DeepSeek-R1 Distill 32B | ~18 GB | 48 GB | Chain-of-thought reasoning, math, analysis |
| Your Hardware | Recommended Tiers | Notes |
|---|---|---|
| Mac M1/M2 8GB | Tiny, Fast | Use Q4_K_M quantization |
| Mac M1/M2 Pro 16GB | Tiny β Standard | Standard tier runs great on Pro chips |
| Mac M3/M4 Pro 18GB+ | Tiny β Versatile | Gemma 3 12B runs well on Pro chips |
| Mac M2/M3 Max 32GB+ | All tiers | Max chips handle even the largest models |
| Mac M2 Ultra 64GB+ | All tiers | No compromises β run anything |
| NVIDIA 8GB VRAM | Tiny, Fast | RTX 3070, 4060, etc. |
| NVIDIA 12GB VRAM | Tiny β Versatile | RTX 3060 12GB, 4070 |
| NVIDIA 24GB VRAM | Tiny β Premium | RTX 3090, 4090 |
| NVIDIA 48GB+ VRAM | All tiers | A6000, A100, multi-GPU setups |
LlamaNet uses a gateway-centric, tunnel-only architecture:
- Gateway (
llamanet.app) β Central registry, authentication, request routing - Inference Nodes β GPU owners running models behind Cloudflare tunnels
- Tunnel URLs β Every node has a public HTTPS URL. No IP:port addressing.
All peer discovery and communication goes through the gateway. There is no peer-to-peer networking, DHT, or distributed hash table. This keeps the system simple, reliable, and NAT-friendly.
You can run a private gateway for your organization or team. The gateway is a lightweight FastAPI server that handles node registration, authentication, request routing, and real-time SSE updates.
The gateway requires a Supabase project for persistence:
- Create a free project at supabase.com
- Run the schema from
sql/schema.sqlin the SQL Editor - Enable Google OAuth in Authentication β Providers (optional)
| Variable | Required | Description |
|---|---|---|
SUPABASE_URL |
β | Your Supabase project URL |
SUPABASE_SECRET_KEY |
β | Supabase service role secret key |
SUPABASE_PUBLISHABLE_KEY |
β | Supabase anon/publishable key |
PORT |
β | Gateway port (default: 8000) |
LLAMANET_DAILY_TOKEN_BUDGET |
β | Daily token limit per API key (default: 500000) |
LLAMANET_HOURLY_COMPUTE_BUDGET |
β | Hourly compute units per API key (default: 10000) |
LLAMANET_MAX_KEY_CONCURRENT |
β | Max concurrent requests per API key (default: 3) |
CF_API_TOKEN |
β | Cloudflare API token (for managed tunnels) |
CF_ACCOUNT_ID |
β | Cloudflare account ID |
CF_ZONE_ID |
β | Cloudflare DNS zone ID |
CF_TUNNEL_DOMAIN |
β | Domain for managed tunnels (default: llamanet.app) |
# Set environment variables
export SUPABASE_URL="https://your-project.supabase.co"
export SUPABASE_SECRET_KEY="your-service-role-key"
# Start gateway
LLAMANET_MODE=landing sh start-app.sh# On inference nodes, point to your gateway
llamanet run hf.co/user/Model:Q4_K_M --bootstrap-peers https://your-gateway.comThe gateway includes a configurable quality gate that validates nodes at registration time. All thresholds default to disabled β set environment variables to enable:
| Variable | Default | Description |
|---|---|---|
LLAMANET_REQUIRE_GPU |
false |
Reject nodes without GPU acceleration |
LLAMANET_REQUIRE_TUNNEL |
false |
Reject nodes without a tunnel URL |
LLAMANET_EXCLUDE_HARDWARE |
β | Comma-separated hardware patterns to reject (e.g. intel-mac,cpu-only) |
LLAMANET_MAX_TTFT |
0 |
Maximum time-to-first-token in seconds (0 = disabled) |
LLAMANET_MAX_LATENCY |
0 |
Maximum latency in seconds (0 = disabled) |
LLAMANET_MIN_TPS |
0 |
Minimum tokens-per-second (0 = disabled) |
Quality gate operates in two phases:
- Hardware check β Instant, no network call (platform, GPU, tunnel URL)
- Performance check β Uses self-reported native probe metrics from the inference node
Every inference node serves a built-in web UI at http://localhost:8000:
- Model Manager β Search Hugging Face for GGUF models, download with real-time progress, switch models without restarting. Opens automatically when no model is loaded.
- Chat Interface β Talk to your model with streaming responses and markdown rendering
- Network Dashboard β See all connected nodes, models, and real-time metrics via SSE
- System Prompt β Configure custom system prompts with presets
The typical workflow is: start your node β open the Web UI β download a model β chat. Switching models is instant β no restart required.
No-Model Mode: When started without a model, the node launches in router-only mode. It can still forward requests to other nodes on the network. Use the Model Manager to download and hot-load a model when ready.
These formats work with ./start-app.sh run and the Web UI Model Manager:
hf.co/user/model # Latest
hf.co/user/model:Q4_K_M # With quantization
user/model:Q4_K_M # Short formatThe Model Manager also accepts plain search queries β just type a model name and browse results.
A tunnel URL is required to join the LlamaNet network. The --tunnel flag handles everything automatically.
sh start-app.sh run hf.co/user/Model:Q4_K_M --tunnelGenerates a temporary URL that changes on restart. No Cloudflare account needed.
cloudflared tunnel login
cloudflared tunnel create bootstrap
cloudflared tunnel route dns bootstrap bootstrap.llamanet.app
sh start-app.sh run hf.co/user/Model:Q4_K_M --tunnelThe URL persists across restarts.
| Variable | Default | Description |
|---|---|---|
MODEL_PATH |
β | Path to GGUF model file |
PORT |
8000 |
HTTP API port |
HOST |
0.0.0.0 |
Bind address |
N_GPU_LAYERS |
-1 |
GPU layers (-1 = all, 0 = CPU only) |
N_CTX |
0 |
Context window in tokens (0 = auto-detect from model) |
N_BATCH |
4096 |
Batch size in tokens |
N_UBATCH |
512 |
Physical micro-batch size in tokens |
N_PARALLEL |
1 |
Number of parallel slots |
N_THREADS |
0 |
CPU threads for generation (0 = auto) |
N_THREADS_BATCH |
0 |
CPU threads for prefill (0 = auto) |
FLASH_ATTN |
false |
Enable FlashAttention |
CACHE_TYPE_K |
f16 |
KV cache key type: f16, q8_0, q4_0 |
CACHE_TYPE_V |
f16 |
KV cache value type: f16, q8_0, q4_0 |
MAX_MODELS |
0 |
Max models in pool (0 = auto-detect from RAM) |
MEMORY_BUDGET_GB |
0 |
Max RAM for models (0 = auto-detect) |
BOOTSTRAP_PEERS |
https://llamanet.app |
Gateway URL (auto-set by installer) |
PUBLIC_IP |
β | Override public IP detection |
LLAMANET_TUNNEL_URL |
β | Override tunnel URL |
NODE_ID |
β | Override auto-generated node ID |
VERBOSE |
false |
Enable verbose llama-cpp-python logging |
| Variable | Default | Description |
|---|---|---|
SUPABASE_URL |
β | Supabase project URL (required) |
SUPABASE_SECRET_KEY |
β | Supabase service role key (required) |
SUPABASE_PUBLISHABLE_KEY |
β | Supabase anon key |
LLAMANET_DAILY_TOKEN_BUDGET |
500000 |
Daily token limit per API key |
LLAMANET_HOURLY_COMPUTE_BUDGET |
10000 |
Hourly compute units per API key |
LLAMANET_MAX_KEY_CONCURRENT |
3 |
Max concurrent requests per API key |
LLAMANET_REQUIRE_GPU |
false |
Quality gate: require GPU |
LLAMANET_REQUIRE_TUNNEL |
false |
Quality gate: require tunnel URL |
LLAMANET_EXCLUDE_HARDWARE |
β | Quality gate: excluded hardware patterns |
LLAMANET_MAX_TTFT |
0 |
Quality gate: max TTFT in seconds |
LLAMANET_MAX_LATENCY |
0 |
Quality gate: max latency in seconds |
LLAMANET_MIN_TPS |
0 |
Quality gate: min tokens per second |
The gateway enforces several rate limits and budgets to ensure fair usage:
| Limit | Default | Scope |
|---|---|---|
| Daily token budget | 500,000 tokens | Per API key (resets midnight UTC) |
| Hourly compute budget | 10,000 units | Per API key |
| Concurrent requests | 3 | Per API key |
| API RPM | 60 | Per API key |
| Global RPM | 500 | All keys combined |
Compute units are estimated based on model size and max_tokens:
- Small models (β€3B): 1Γ multiplier
- Medium models (7-8B): 2Γ multiplier
- Large models (13-20B): 4-6Γ multiplier
- Very large models (β₯35B): 8Γ multiplier
Check your usage at /auth/token-usage (requires authentication).
| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions |
POST | Chat completion (streaming supported) |
/v1/completions |
POST | Text completion (streaming supported) |
/v1/models |
GET | List all models in the pool |
/v1/models/network |
GET | List local models with node metadata |
/models/search |
GET | Search Hugging Face for GGUF models |
/models/details/{repo_id} |
GET | Get model details including GGUF files |
/models/download |
POST | Start downloading a model |
/models/download/status |
GET | SSE stream for download progress |
/models/download/{id} |
DELETE | Cancel an active download |
/models/local |
GET | List locally cached models |
/models/local/{id} |
DELETE | Delete a local model |
/models/select |
POST | Switch or load a model (pool or replace mode) |
/models/pool |
GET | Current pool status |
/models/pool/evict |
POST | Manually evict a model from the pool |
/models/pool/capacity |
GET | Pool capacity info |
/models/statistics |
GET | Local model statistics |
/models/system-info |
GET | Hardware specs for client-side filtering |
/events/network |
GET | SSE stream for real-time network events |
/health |
GET | Health check |
/status |
GET | Node status and metrics |
/info |
GET | Node configuration info |
/tunnel/status |
GET | Tunnel status and URL |
| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions |
POST | Route chat completion to best node (requires API key) |
/v1/completions |
POST | Route completion to best node (requires API key) |
/v1/models |
GET | List all available models (requires API key) |
/api/models |
GET | Public model listing |
/api/models/{slug} |
GET | Get nodes for a specific model |
/api/network/stats |
GET | Network statistics |
/events/network |
GET | SSE stream for network events |
/auth/google |
GET | Google OAuth login |
/auth/me |
GET | Current authenticated user |
/auth/api-keys |
GET | List user's API keys |
/auth/api-keys |
POST | Create a new API key |
/auth/api-keys/{id} |
DELETE | Revoke an API key |
/auth/token-usage |
GET | Today's token usage for user's API keys |
/health |
GET | Gateway health check |
Apple Silicon (M1/M2/M3/M4) β full GPU acceleration via Metal, no extra steps:
# One-liner install (recommended)
curl -sSL https://llamanet.app/install.sh | sh
llamanetOr install from source:
git clone https://github.com/machaao/llama-net.git
cd llama-net
pip install -r requirements-inference.txt
sh start-app.sh --tunnel --bootstrap-peers https://llamanet.appIntel Macs β Metal shaders in llama-cpp-python 0.3.x are incompatible with Intel GPUs.
LlamaNet auto-detects Intel Macs and disables Metal at startup (CPU-only mode). No manual configuration needed.
If you need to force it manually:
export LLAMA_NO_METAL=1
llamanetYou can also pass --no-gpu to the inference node directly:
python -m inference_node.server --no-gpu --tunnel --bootstrap-peers https://llamanet.appWorks on any Linux distro with Python 3.9+. For NVIDIA GPUs, ensure drivers and CUDA are installed:
# One-liner install (recommended)
curl -sSL https://llamanet.app/install.sh | sh
llamanetOr install from source:
git clone https://github.com/machaao/llama-net.git
cd llama-net
pip install -r requirements-inference.txt
sh start-app.sh --tunnel --bootstrap-peers https://llamanet.appFor CPU-only or non-NVIDIA setups:
N_GPU_LAYERS=0 llamanetWorks on Windows 10/11 with Python 3.9+. For NVIDIA GPUs, ensure drivers and CUDA are installed:
# One-liner install (recommended)
irm https://llamanet.app/install.ps1 | iex
llamanetOr install from source:
git clone https://github.com/machaao/llama-net.git
cd llama-net
pip install -r requirements-inference.txt
start-app.bat --tunnel --bootstrap-peers https://llamanet.appFor CPU-only mode:
set N_GPU_LAYERS=0
start-app.bat --tunnel --bootstrap-peers https://llamanet.appNotes:
- Use
start-app.batinstead ofsh start-app.shon Windows - Python must be in your PATH (install from python.org with "Add to PATH" checked)
cloudflaredfor tunnels can be downloaded from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/
Run a node on any VPS or cloud instance (AWS, GCP, Azure, Hetzner, etc.):
curl -sSL https://llamanet.app/install.sh | sh
llamanet run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:Q4_K_MGPU instances: Install NVIDIA drivers + CUDA toolkit before running. The node auto-detects GPU availability.
CPU instances: Set N_GPU_LAYERS=0 or use --no-gpu. Smaller models (β€3B parameters) work well on CPU.
Persistent tunnel: For a stable URL across restarts, set up a named Cloudflare tunnel:
cloudflared tunnel login
cloudflared tunnel create my-node
cloudflared tunnel route dns my-node node.mydomain.com
llamanet run hf.co/user/Model:Q4_K_M --tunnelDon't have a GPU? Rent one by the hour and run LlamaNet in 2 minutes.
- Go to runpod.io and create an account
- Click Deploy β Custom β paste Docker image:
machaao/llamanet:latest - Select a GPU (see sizing table below)
- Set Environment Variables:
MODEL_URL=hf.co/mistralai/Ministral-3-8B-Instruct-GGUF:Q4_K_M
- Expose Port 8000 (TCP)
- Click Deploy
- Open the proxy URL β Web UI loads automatically
- Your node joins the
llamanet.appnetwork
| GPU | VRAM | Recommended Models | ~Cost/hr |
|---|---|---|---|
| RTX 4060 | 8 GB | Phi-4 Mini, Qwen 4B | ~$0.20 |
| RTX 4090 | 24 GB | Ministral 8B, Gemma 12B, Qwen 14B | ~$0.44 |
| A100 80GB | 80 GB | Qwen 35B, DeepSeek-R1 32B | ~$1.64 |
Environment Variables:
| Variable | Default | Description |
|---|---|---|
MODEL_URL |
(empty) | HuggingFace model URL (e.g. hf.co/user/Model:Q4_K_M) |
ENABLE_TUNNEL |
true |
Join public llamanet.app network |
N_GPU_LAYERS |
-1 |
GPU layers (-1 = all) |
N_CTX |
4096 |
Context window in tokens |
BOOTSTRAP_PEERS |
https://llamanet.app |
Gateway URL |
- Go to vast.ai and create an account
- Search for GPU rentals β click Rent on a machine
- Set Docker Image:
machaao/llamanet:latest - Set Environment Variables (same as RunPod above)
- Set Port Mapping:
8000 - Launch β Web UI available at the instance proxy URL
The image is published at machaao/llamanet:latest:
# Run locally with GPU
docker run --gpus all -p 8000:8000 \
-e MODEL_URL="hf.co/mistralai/Ministral-3-8B-Instruct-GGUF:Q4_K_M" \
machaao/llamanet:latest
# Run without GPU (CPU only)
docker run -p 8000:8000 \
-e MODEL_URL="hf.co/mistralai/Ministral-3-8B-Instruct-GGUF:Q4_K_M" \
-e N_GPU_LAYERS=0 \
machaao/llamanet:latestNote: The MACHAAO cloud platform handles containerization automatically β a
Dockerfileis not required for cloud deployment. Usestart-app.shas the entrypoint and deploy via the/deploycommand.
git clone https://github.com/machaao/llama-net.git
cd llama-net
docker build -t yourusername/llamanet:latest .
docker push yourusername/llamanet:latestFor dedicated GPU machines (desktop, workstation, or server):
-
Install with one command:
curl -sSL https://llamanet.app/install.sh | sh -
Start with a model:
llamanet run hf.co/mistralai/Ministral-3-8B-Instruct-GGUF:Q4_K_M
-
Or start empty and download via Web UI:
llamanet
Open
http://localhost:8000β Model Manager β search β download β chat. -
Switch models at any time via the Web UI without restarting.
Tips:
- Use
--ctx-sizeto control context window (default: 4096) - Use
--gpu-layers -1to offload all layers to GPU (default) - Use
--gpu-layers Nto split between GPU and CPU for large models - The node auto-generates a persistent ID stored in
~/.llamanet_node_id - The node auto-joins the public network at
llamanet.app(override with--bootstrap-peers)
LlamaNet is built on top of these open-source projects:
- llama.cpp β Fast LLM inference in C/C++ with Apple Metal, CUDA, and CPU support. The core engine that runs all GGUF models.
- llama-cpp-python β Python bindings for llama.cpp with OpenAI-compatible API support.
- FastAPI β High-performance Python web framework for the API server.
- Cloudflare Tunnels β Automatic public HTTPS URLs for every node.
- Supabase β Backend for gateway authentication, node registry, and API keys.
- Hugging Face β Model discovery and GGUF file hosting.
- Python 3.9+
- GGUF format models
- 4GB+ RAM (depends on model size)
cloudflared(auto-installed by the installer andstart-app.shon macOS/Linux)- llama.cpp β C/C++ inference engine that powers all GGUF model execution via llama-cpp-python
