π€ Decentralized LLM compute marketplace. Anyone can contribute GPU power and earn. Anyone can access affordable AI.
LLM inference is expensive. OpenAI, Claude, Geminiβthey all charge premium prices because they own the compute. Meanwhile, millions of people and businesses have idle GPU capacity: a gaming PC, a cloud instance running 4 hours a day, a research lab with spare hardware.
Why should all that compute go unused? Why should consumers pay centralized prices when free-market competition could drive costs down by 10x or 100x?
LocalLMarket is a decentralized marketplace where:
- Workers (anyone with a GPU) register a model, set their own price, and earn credits per completed request.
- Consumers find the best-priced worker meeting their needs and call the model via a simple API.
- The platform matches orders, streams responses, settles payments, and tracks reputation.
No gatekeepers. No middlemen. Just fair-market pricing and community compute.
| Feature | LocalLMarket | Centralized APIs |
|---|---|---|
| Pricing | Free market competition | Fixed, premium rates |
| Decentralization | Anyone can contribute compute | Single point of failure |
| Control | Run any model, fine-tune yours | Limited model selection |
| Community | Join a peer network, earn back | Extract value, no stake |
| Transparency | See all pricing, all workers | Black box |
- Worker honesty: We can't cryptographically verify workers return correct output (mitigation: reputation scoring, consumer feedback)
- Reputation system: Currently simple (24h uptime tracking)
- UI: Headless for now; worker dashboard and consumer dashboard to come in future releases
ββββββββββββββββ
β Consumer β
β (Your App) β
ββββββββ¬ββββββββ
β "I need gpt-3.5 for $0.01/MTks"
β
βΌ
ββββββββββββββββββββββββββββββ
β LocalLMarket API Server β ββββ WebSocket βββ Worker 1 (llama-2, $0.005/MTks)
β β ββββ WebSocket βββ Worker 2 (llama-2, $0.008/MTks)
β β’ Order matching β ββββ WebSocket βββ Worker 3 (gpt-3.5 fine-tune, $0.002/MTks)
β β’ Price discovery β
β β’ Streaming relay β
β β’ Payment settlement β
ββββββββββββββββββββββββββββββ
β
βΌ Stream response (OpenAI format)
ββββββββββββββββ
β Response β "The answer is..."
β (SSE) β
ββββββββββββββββ
What you do:
- Register your machine and model on LocalLMarket
- Set your own price (per million tokens)
- Listen for incoming requests
- Run LLM inference on your hardware
- Stream output back to the consumer
- Get credited per completed job
Getting Started:
# Step 1: Create account and get API key from POST /users
# Step 2: Register your model
WORKER_API_KEY=your_key_here WORKER_MODEL=llama-2 WORKER_PRICE=0.005 docker compose -f worker/compose.dev.yaml up -d --buildPricing Strategy:
- You set the rate. Lower price β more demand β higher volume.
- Set fair rates β build reputation β consistent long-term earnings.
- Optimize hardware. More efficient = higher margins.
What you do:
- Create account and get API key
- Search available workers and models
- Call any model via OpenAI-compatible API
- System automatically picks the best worker (lowest price, meets your constraints)
- Stream response back to your app
- Get billed per million tokens used
Getting Started:
# Step 1: Create account and get API key
curl -X POST http://localhost/users \
-H "Content-Type: application/json" \
-d '{"username":"alice","email":"alice@email.com"}'
# Step 2: Check available workers
curl http://localhost/workers/public
# Step 3: Call a model (OpenAI-compatible)
curl http://localhost/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-2",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true,
}'Python Example:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="http://localhost"
)
response = client.chat.completions.create(
model="llama-2",
messages=[{"role": "user", "content": "Explain p2p markets"}],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content, end="")What to do:
- Clone the repo and explore the architecture
- Run the stack locally with Docker Compose
- Integrate the OpenAI-compatible API into your app
- Test with real workers
- Deploy to production or self-host
Getting Started:
# Clone and setup
git clone https://github.com/locallmarket/locallmarket.git
cd locallmarket
# Start the API (port 80)
docker compose -f api/compose.yaml up -d --build
# Start a worker (outbound WebSocket to API)
docker compose -f worker/compose.dev.yaml up -d --build
# Test the health endpoint
curl http://localhost/ready
# Run the test suite
npm test
# See full API reference in .github/skills/api-development/SKILL.mdβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LocalLMarket API Server β
β β
β ββββββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β HTTP Routes β β Worker WebSocket Server β β
β β β β β β
β β β’ POST /users β β β’ Worker registration β β
β β β’ GET /workers/poolβ β β’ Job dispatch β β
β β β’ POST /v1/chat β β β’ Stream relay β β
β β β’ GET /orders β β β’ Heartbeat monitoring β β
β β β’ GET /ready β β β β
β ββββββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββ β
β β Order Queue & Matching β β
β β β β
β β β’ Price discovery β β
β β β’ Worker selection β β
β β β’ Job state tracking β β
β ββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββ β
β β MySQL Database β β
β β β β
β β β’ Users & API keys β β
β β β’ Workers & offers β β
β β β’ Orders & billing β β
β β β’ Reputation scores β β
β ββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β³ β³
β β
HTTP β (Consumer) WebSocket β (Worker)
β β
Consumer App Worker Service
Key Design Principles:
- API owns the HTTP surface and worker queue; thin composition root (
api/app.js) - Workers connect outbound via WebSocket; API doesn't initiate connections
- Settlement happens per-job: Consumer credits deducted β Worker credits incremented
- Reputation updated every 24h: Uptime tracking, request count, reputation score
GET /ready
Response: { "ok": true, "connectedWorkers": 5, "availableWorkers": 4, "activeJobs": 2, "queuedJobs": 0 }
POST /users # Create account
GET /users # Get profile
PUT /users # Update profile settings (max_price, min_tps)
POST /users/recharge # Recharge account credits
POST /users/reset # Reset account API Key
GET /workers # See all my registered workers (requires auth)
GET /workers/public # See all public workers available for matching
POST /workers # Register a worker
GET /orders # Your order history
POST /v1/chat/completions # Call a model (OpenAI-compatible)
POST /v1/responses # Call a model with OpenAI Responses API
For full details, see .github/skills/api-development/SKILL.md
- Hardware: GPU (recommended) or multi-core CPU
- Software: Python 3.8+, any LLM runtime (vLLM, ollama, llama.cpp)
- Network: Stable internet, outbound WebSocket access to API server
Option 1: Docker (Recommended)
# Clone repo
git clone https://github.com/locallmarket/locallmarket.git
cd locallmarket/worker
# Build the worker container
docker build -t locallmarket-worker .
# Run with your API key
docker run -e WORKER_API_KEY=your_key_here \
-e WORKER_MODEL=llama-2 \
-e WORKER_PRICE=0.005 \
-e WORKER_TPS=50 \
locallmarket-workerOption 2: Local Development
cd worker
npm install
WORKER_API_KEY=your_key WORKER_MODEL=llama-2 npm start| Env Var | Example | Purpose |
|---|---|---|
WORKER_API_KEY |
sk_abc123 |
Your API key from LocalLMarket |
WORKER_MODEL |
llama-2 |
Model name to advertise |
WORKER_PRICE |
0.005 |
Price per request (in credits) |
WORKER_TPS |
50 |
Throughput (requests per second) |
API_ENDPOINT |
http://api.locallmarket.com |
API server URL |
# Check your worker status
curl http://api.locallmarket.com/workers \
-H "Authorization: Bearer YOUR_API_KEY"
# Response includes: activeJobs, completedJobs, totalEarnings, uptime%, reputation- Undercut competitors: If others charge $0.01, try $0.008 β more demand
- Build reputation: Consistent, fair pricing β long-term trust β stable volume
- Monitor peers: Use
/workers/publicto see competitor pricing in real-time - Optimize hardware: Faster execution = higher TPS = more requests/earnings
- Account: Free signup with email (You get an API key)
- Network: HTTPS access to API endpoint
- Integration: Your app (Python, Node.js, curl, anything)
Step 1: Create Account
curl -X POST http://localhost/users \
-H "Content-Type: application/json" \
-d '{
"name": "User",
"email": "user@example.com",
}'
# Returns: { "ok": true, "apiKey": "..." }Step 2: Add Credits
curl -X POST http://localhost/users/recharge \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "amount": 100 }' # 100 creditsStep 3: Explore Workers
curl http://localhost/workers/public \Step 4: Call a Model
curl -X POST http://localhost/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-2",
"messages": [
{ "role": "system", "content": "You are helpful." },
{ "role": "user", "content": "What is 2+2?" }
],
"stream": true,
"temperature": 0.7,
"max_tokens": 100
}'Update your user preferences to control cost and performance:
{
"max_price": 0.01, // Don't use workers charging > $0.01/req
"min_tps": 50, // Don't use workers with < 50 req/sec throughput
}const OpenAI = require('openai');
const client = new OpenAI({
apiKey: process.env.LOCALLMARKET_API_KEY,
baseURL: 'http://localhost'
});
async function chat() {
const stream = await client.chat.completions.create({
model: 'llama-2',
messages: [{ role: 'user', content: 'Hello!' }],
stream: true
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || '');
}
}
chat();Can we verify workers are honest?
β οΈ Today: No cryptographic proof. We rely on reputation and consumer feedback.- Future:
- Dispute resolution system for consumer complaints
Found a bug? Have a feature idea? Want to run a worker? We'd love your help!
- Open an issue on GitHub
- Follow the template and provide reproduction steps
- Describe what you expected vs. what happened
- Read .github/instructions.md
- Fork the repo, create a branch, make your changes
- Add tests and run the test suite (
npm test) - Submit a pull request with a clear description
- Our team will review and merge
- Join the network and contribute GPU power
- Set competitive pricing
- Help other workers and consumers on community forums
- Share feedback on how we can improve
# Install dependencies
npm install
# Run unit and integration tests
npm test
# Run tests with coverage
npm test -- --coverage
# Lint
npm run lint- API Development: .github/skills/api-development/SKILL.md
- Testing Guide: .github/skills/api-testing/SKILL.md
- Docker Setup: .github/skills/docker-deployment/SKILL.md
- Bug Review: .github/skills/backend-bug-review/SKILL.md
LocalLMarket is released under the MIT License. See LICENSE for details.
- GitHub Issues: Report bugs or request features
- Discussions: Community chat and ideas
- Email: support@locallmarket.com
Ready to join the decentralized compute marketplace? Start as a worker, consumer, or developer. π