Blazingly fast Redis-over-HTTP adapter - Self-hosted alternative to Upstash, built with Rust.
Ever wanted to use Redis from edge functions or serverless environments but hit walls? Services like Upstash work, but they lock you in and can get expensive at scale.
Stashless is a self-hosted HTTP adapter for Redis that's fully compatible with the Upstash SDK. Get the same API without vendor lock-in or per-request pricing. Just pure Redis performance over HTTP.
Use it for:
- Edge functions (Cloudflare Workers, Vercel Edge)
- Serverless environments (Lambda, Cloud Functions)
- Local development with Upstash-compatible apps
- Anywhere you need Redis over HTTP
If you already have Redis running:
# Pull the image
docker pull ghcr.io/elydelva/stashless:latest
# Run the container
docker run -d \
-p 3000:3000 \
-e SLASHLESS_REDIS_HOST=your-redis-host \
-e SLASHLESS_REDIS_PORT=6379 \
-e SLASHLESS_TOKEN=your-secret-token \
ghcr.io/elydelva/stashless:latestThat's it! The API is available at http://localhost:3000.
git clone https://github.com/elydelva/slashless.git
cd slashless
# Set your token
export SLASHLESS_TOKEN=your-secret-token-here
# Start everything
docker-compose up -dgit clone https://github.com/elydelva/slashless.git
cd slashless
cargo build --release
# Set environment variables
export SLASHLESS_REDIS_HOST=127.0.0.1
export SLASHLESS_REDIS_PORT=6379
export SLASHLESS_TOKEN=your-secret-token
# Run
./target/release/stashlessAll configuration is done via environment variables. Only SLASHLESS_TOKEN is required.
To create a new configuration, you can use a .env file in your project root:
# Generate a secure token first (or use stashless generate-token)
# Then create a .env file:
cat > .env << EOF
SLASHLESS_TOKEN=your-secret-token-here
SLASHLESS_REDIS_HOST=127.0.0.1
SLASHLESS_REDIS_PORT=6379
SLASHLESS_HOST=0.0.0.0
SLASHLESS_PORT=3000
SLASHLESS_MAX_CONNECTION=3
SLASHLESS_MAX_RETRY=-1
SLASHLESS_MODE=standard
EOFOr use the stashless generate-token command to generate a secure token, then add it to your .env file.
| Variable | Default | Description |
|---|---|---|
SLASHLESS_REDIS_HOST |
127.0.0.1 |
Redis host |
SLASHLESS_REDIS_PORT |
6379 |
Redis port |
SLASHLESS_HOST |
0.0.0.0 |
HTTP bind address |
SLASHLESS_PORT |
3000 |
HTTP port |
SLASHLESS_TOKEN |
Required | Bearer token for auth |
SLASHLESS_MAX_CONNECTION |
3 |
Connection pool size |
SLASHLESS_MAX_RETRY |
-1 |
Maximum Redis connection retry attempts (-1 for unlimited) |
SLASHLESS_MODE |
standard |
Console display mode (standard or rich) |
Stashless supports two console display modes:
standard(default): Simple text-based output with standard logging. Best for production environments, CI/CD pipelines, and when running in the background.rich: Enhanced terminal UI with real-time status updates, colored output, and interactive console. Best for local development and monitoring.
Set the mode using the SLASHLESS_MODE environment variable:
# Standard mode (default)
export SLASHLESS_MODE=standard
# Rich mode
export SLASHLESS_MODE=richYou can also use a .env file - just export it before running.
Works exactly like Upstash:
import { Redis } from "@upstash/redis";
const redis = new Redis({
url: "http://localhost:3000",
token: "your-secret-token",
});
await redis.set("key", "value");
const value = await redis.get("key");# Set a value
curl -X POST http://localhost:3000/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-token" \
-d '{"command": "SET", "args": ["hello", "world"]}'
# Get a value
curl -X POST http://localhost:3000/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-token" \
-d '{"command": "GET", "args": ["hello"]}'# Pipeline
curl -X POST http://localhost:3000/pipeline \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-token" \
-d '{"commands": [{"command": "SET", "args": ["key1", "value1"]}]}'
# Transaction
curl -X POST http://localhost:3000/multi-exec \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-token" \
-d '{"commands": [{"command": "INCR", "args": ["counter"]}]}'Stashless supports all standard Redis commands - strings, lists, sets, hashes, sorted sets, keys, and transactions.
Contributions welcome! Here's how:
- Fork and clone
- Create a branch:
git checkout -b feature/your-feature - Make your changes
- Run tests:
cargo test && bun test - Format code:
cargo fmt && cargo clippy - Commit following Conventional Commits
- Push and open a PR
MIT License - see LICENSE for details.
Copyright (c) 2024 Stashless Contributors
