KubeFn Python Runtime — Live Application Fabric for Memory-Continuous Architecture
Project description
KubeFn Python Runtime
Memory-Continuous Architecture for Python — Functions share a CPython interpreter heap. Zero serialization between functions.
KubeFn is a Live Application Fabric where independently deployable functions share memory. The Python runtime brings this to ML/data science teams.
Install
pip install kubefn
Quick Start
from kubefn import function, HeapExchange
@function(path="/ml/features", methods=["POST"])
def extract_features(request, ctx):
"""Extract ML features and publish to shared heap."""
user_id = request.get("userId", "user-001")
features = {
"recency": 0.8,
"frequency": 12,
"monetary": 450.0,
"category_affinity": [0.3, 0.7, 0.1],
}
# Publish to heap — other functions read this zero-copy
ctx.heap.publish(f"features:{user_id}", features)
return {"features": len(features), "userId": user_id}
@function(path="/ml/predict", methods=["POST"])
def predict(request, ctx):
"""Read features from heap (zero-copy) and run inference."""
features = ctx.heap.require("features:user-001") # Same Python object, not deserialized
score = sum(features.values()) / len(features) if isinstance(features, dict) else 0.5
ctx.heap.publish("prediction:latest", {"score": score, "model": "v2"})
return {"prediction": score}
Run
# Start the runtime
kubefn-python --port 8080 --functions-dir ./my-functions
# Or with Python module
python -m kubefn --port 8080 --functions-dir ./my-functions
Production Features
| Feature | Description |
|---|---|
| HeapExchange | Zero-copy shared Python objects between functions |
| Circuit Breakers | Per-function failure isolation (CLOSED/OPEN/HALF_OPEN) |
| Drain Manager | Graceful hot-swap with in-flight request tracking |
| Request Timeout | Configurable per-request deadline enforcement |
| Causal Introspection | Event ring buffer with trace assembly |
| Prometheus Metrics | Per-function latency histograms in exposition format |
| Heap Guard | Size limits, TTL, memory pressure detection |
| Scheduler Engine | Cron-based function scheduling (@schedule) |
| Admin API | 12 endpoints: health, ready, functions, heap, breakers, metrics, traces, scheduler |
Benchmarks
In-cluster (service-to-service on k3s):
- 3-step ML pipeline: 5.4ms (vs 6-30ms equivalent microservices)
- Speedup: 1.1-5.5x (full HTTP cycle, honestly measured)
Links
- Website: https://kubefn.com
- GitHub: https://github.com/kubefn/kubefn
- Paper: DOI: 10.5281/zenodo.19161471
- JVM Runtime:
com.kubefn:kubefn-apion Maven Central - CLI:
brew tap kubefn/tap && brew install kubefn
Project details
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 kubefn-0.8.0.tar.gz.
File metadata
- Download URL: kubefn-0.8.0.tar.gz
- Upload date:
- Size: 30.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
092bb17cfc45444ebffe7dac5581d14853e649d574367ad0e909e7665dfd1ec5
|
|
| MD5 |
11be415980700c5087de6f7ace017521
|
|
| BLAKE2b-256 |
3f4f31709b67a664e2ca5e01d9956f28775548e182b165708f37657e544e23ea
|
Provenance
The following attestation bundles were made for kubefn-0.8.0.tar.gz:
Publisher:
release.yml on kubefn/kubefn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kubefn-0.8.0.tar.gz -
Subject digest:
092bb17cfc45444ebffe7dac5581d14853e649d574367ad0e909e7665dfd1ec5 - Sigstore transparency entry: 1191822222
- Sigstore integration time:
-
Permalink:
kubefn/kubefn@f49ecef04e01affae33404576dcc8643bb8bb253 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/kubefn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f49ecef04e01affae33404576dcc8643bb8bb253 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kubefn-0.8.0-py3-none-any.whl.
File metadata
- Download URL: kubefn-0.8.0-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71dcdd4f89547df5bb39c713f904bb0f64fd86a6561a50bd4eaa5a4073b748dc
|
|
| MD5 |
d7abf578d354535c88c472afb7701fe6
|
|
| BLAKE2b-256 |
bcc75c2d76b94ece1ba89415c6f61ba846325dce1b2096800493e8ef6d5cc0cb
|
Provenance
The following attestation bundles were made for kubefn-0.8.0-py3-none-any.whl:
Publisher:
release.yml on kubefn/kubefn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kubefn-0.8.0-py3-none-any.whl -
Subject digest:
71dcdd4f89547df5bb39c713f904bb0f64fd86a6561a50bd4eaa5a4073b748dc - Sigstore transparency entry: 1191822226
- Sigstore integration time:
-
Permalink:
kubefn/kubefn@f49ecef04e01affae33404576dcc8643bb8bb253 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/kubefn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f49ecef04e01affae33404576dcc8643bb8bb253 -
Trigger Event:
push
-
Statement type: