self-hosting made effortless

pip install syft-serve
import syft_serve as ss
import requests

def hello():
    return "Hi!"

server = ss.create("my_api", {"/": hello})

requests.get(server.url).text
"Hi!"

Why We Built This

self-hosting should be effortless

☁️ The cloud isn't yours

Not your computer, not your control. Cloud providers can change terms, raise prices, or shut down your app anytime.

🏠 Yours is inconvenient

Self-hosting means wrestling with configs, ports, and processes. Complexity keeps you dependent on cloud APIs.

✨ Convenience is possible

Self-hosting should be a 1-liner behind the scenes. With syft-serve, your own server is just one function call away.

See It In Action

self-hosting can be effortless

Under the Hood

Here's what syft-serve does for you

# You write:
server = ss.create("my_api", {"/predict": my_function})

# Behind the scenes:
# ✓ Spins up isolated Python environment
# ✓ Installs your dependencies safely  
# ✓ Generates production-ready FastAPI code
# ✓ Manages server process lifecycle
# ✓ Streams logs for easy debugging
# ✓ Cleans up everything when done

# No orphan processes. No port conflicts. No hassle.

The Complete API

Everything you need, nothing you don't

Create & Customize

import syft_serve as ss

# Basic usage
server = ss.create("my_api", {"/hello": hello_func})

# Full control
server = ss.create(
    name="my_api",
    endpoints={"/predict": predict, "/train": train},
    dependencies=["numpy", "pandas"],
    port=8080,
    expiration_seconds=3600,  # Auto-cleanup
    force=True                # Replace existing
)

Server Management

# List all servers
servers = ss.list()

# Get specific server
server = ss.get("my_api")

# Access server properties
server.url          # http://localhost:8080
server.endpoints    # ["/predict", "/train"]
server.status       # "running"
server.uptime       # "2h 15m"

Logs & Debugging

# Stream logs in real-time
server.stdout.follow()

# Get recent logs
server.stdout.tail(20)
server.stderr.tail(20)

# Check environment
server.env.packages    # Installed packages
server.env.python      # Python version

Lifecycle Control

# Graceful shutdown
server.terminate()

# Force kill if needed
server.force_terminate()

# Clean up all servers
ss.terminate_all()

# Auto-expiring servers
ss.create("temp_api", endpoints, 
         expiration_seconds=300)  # 5 min

try it out

experience syft-serve in google colab

open in colab