No project description provided
Project description
Modulith
Build once. Use everywhere. Scale effortlessly.
Modulith is a framework for building systems as composable, shareable modules.
Start simple.
Structure as modules.
Scale by distributing them, without rewriting your code.
🚀 What You Get
- 🧱 Scalable by design — move from local → distributed seamlessly
- 🔗 Composable architecture — build systems by combining modules
- 🌐 Shareable modules — publish and reuse across projects
- 🔌 Unified interface — local and remote calls look identical
- 🔐 Built-in access control — safely expose your modules
📦 Install
pip install modulith
🚀 Quick Start
Build and run locally. Fast, no latency, easy to debug.
# calculator/module.py
from modulith import Modulith
module = Modulith("calculator")
@module.capability("add")
def add(a: float, b: float) -> float:
return a + b
result = module("add", kwargs={"a": 1, "b": 2})
# → 3
🌐 Use Anywhere
Serve your module on any machine and use it from anywhere.
# Serve the module with public access and rate limits
modulith run \
--module-source calculator.module \
--public \ # Accessible by anyone
--rate-limit 100 \ # 100 requests per minute (public users)
--burst-limit 20 # Allow short bursts up to 20 requests
🔑 Your authentication token: ...
🌐 Module 'calculator' is live:
- Repository: user3bef3/calculator
- Public URL: https://6ebm5g.instatunnel.my
- Local URL: http://localhost:8000
⚙️ Capabilities:
- add(a: float, b: float) → float
⚡ Public access limits:
- Rate limit: 100 requests/minute
- Burst limit: 20 requests
🛑 Press Ctrl+C to stop
Connect to your module from any machine:
calculator = Modulith.remote(
"user3bef3/calculator",
access_token="..." # Use the same token displayed in the console when you ran the module
)
result = calculator("add", kwargs={"a": 1, "b": 2})
# → 3 (executed remotely)
Same interface. Local or remote, no difference.
⚖️ Effortless Scaling
Scale horizontally by running multiple instances of the same module across machines. Each instance joins a shared pool and serves requests automatically.
# Serve the module on serverless instances (i.e., AWS Fargate)
modulith serve \
--module-source calculator.module \
--instances 5 \ # Run 5 instances
--num-cores 2 \ # Each instance uses 2 CPU cores
--memory 1GB \ # Each instance has 1GB of RAM
--public \ # Accessible by anyone
--rate-limit 100 \ # 100 requests per minute (public users)
--burst-limit 20 \ # Allow short bursts up to 20 requests
--auth-token <your-auth-token> # Use the same token to group instances
Tip: Use the same
--auth-tokenacross all instances to group them into the same pool. Instances using different tokens will run different pools.
🔗 Compose Modules
Build new modules by calling existing modules, local or remote.
new_module = Modulith()
calculator = Modulith.remote("user3bef3/calculator", access_token="...")
@new_module.capability("double_sum")
def double_sum(a: float, b: float) -> float:
return calculator("add", kwargs={"a": a, "b": b}) + calculator("add", kwargs={"a": a, "b": b}) # calls remote calculator module
result = new_module("double_sum", kwargs={"a": 1, "b": 2})
# → 6
Execution flow
inputs → double_sum(1, 2)
→ add(1, 2) (remote)
→ 3 (return)
→ add(1, 2) (remote)
→ 3 (cache hit, return)
→ 3 + 3 (local)
→ 6
👤 Optional: Create Account
Avoid manual auth/access tokens management by linking modules to your account.
modulith signup # Create an account (if you don't have one)
modulith login
🌐 Module 'calculator' is live:
- Repository: <your_username>/calculator
...
Your module is now automatically registered and managed under your account.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modulith-0.1.3.tar.gz.
File metadata
- Download URL: modulith-0.1.3.tar.gz
- Upload date:
- Size: 40.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c0d49006855007363c9dd40132548e5723ba8563c828581ca6b9a57a1801ecf
|
|
| MD5 |
ff9e54a46144c5390fb73caa2f949588
|
|
| BLAKE2b-256 |
740012ec5785d3c5844836053c2a72400e0cc5c573046ce416ab6dcff8be3678
|
Provenance
The following attestation bundles were made for modulith-0.1.3.tar.gz:
Publisher:
python-publish.yml on modulith-labs/modulith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modulith-0.1.3.tar.gz -
Subject digest:
7c0d49006855007363c9dd40132548e5723ba8563c828581ca6b9a57a1801ecf - Sigstore transparency entry: 1280662223
- Sigstore integration time:
-
Permalink:
modulith-labs/modulith@d2300520a6a30b67e78e2f37336b9141946682a8 -
Branch / Tag:
refs/tags/update-feature - Owner: https://github.com/modulith-labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d2300520a6a30b67e78e2f37336b9141946682a8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file modulith-0.1.3-py3-none-any.whl.
File metadata
- Download URL: modulith-0.1.3-py3-none-any.whl
- Upload date:
- Size: 66.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0deb530af0e3328028a2964e5096caf62122f9bd3a6bb68acc2e6dcc27cbdaf0
|
|
| MD5 |
5e9b58843c125aeff16948684586338e
|
|
| BLAKE2b-256 |
c5960e71c2b0cc83af01a1b50aa3e06cef8e5e28f37c3131bea7ea53cd87469f
|
Provenance
The following attestation bundles were made for modulith-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on modulith-labs/modulith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modulith-0.1.3-py3-none-any.whl -
Subject digest:
0deb530af0e3328028a2964e5096caf62122f9bd3a6bb68acc2e6dcc27cbdaf0 - Sigstore transparency entry: 1280662226
- Sigstore integration time:
-
Permalink:
modulith-labs/modulith@d2300520a6a30b67e78e2f37336b9141946682a8 -
Branch / Tag:
refs/tags/update-feature - Owner: https://github.com/modulith-labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d2300520a6a30b67e78e2f37336b9141946682a8 -
Trigger Event:
release
-
Statement type: