Skip to content

OpenMined/syft-serve

syft-serve

PyPI Python License Docs Code style: black Ruff OpenMined

Self-hosting should be effortless

Turn any Python function into a self-hosted server in one line. No DevOps required.

import syft_serve as ss
import requests

def hello():
    return "Hi!"

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

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

Installation

pip install syft-serve

Why syft-serve?

☁️ The cloud isn't yours - Not your computer, not your control
🏠 Yours is inconvenient - Self-hosting means wrestling with configs
Convenience is possible - Self-hosting should be a 1-liner

What it does

# 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.

See It In Action

Documentation

📖 Full documentation and examples

See interactive tutorials, videos, and complete API reference.

License

Apache 2.0 - see LICENSE file for details.

About

launch & manage stateless FastAPI servers in a single line of python

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published