How is it better?
Importing libraries is most of a serverless cold start. Readie moves that work ahead of time. A pipeline starts Python with common packages already imported and saves the process as a checkpoint.
When a call arrives, the router picks a worker and the checkpoint that holds the packages the function needs. The worker restores that checkpoint in a gVisor sandbox and runs the function.
app.py
from readie import remote
import pandas as pd
from sklearn.linear_model import LogisticRegression
@remote
def pass_probability(rows, hours):
data = pd.DataFrame(rows)
X, y = data[["hours"]], data["passed"]
model = LogisticRegression().fit(X, y)
new = pd.DataFrame({"hours": [hours]})
return float(model.predict_proba(new)[0, 1])
rows = [
{"hours": h, "passed": int(h > 3)}
for h in range(1, 7)
]
print(pass_probability(rows, 3.5)) # about 0.5
Cold start
- Start Python
- import pandas
- import sklearn
- import sklearn.linear_model
- Run function
Restored from a checkpoint
- Restore checkpoint
- Run function
Try Readie
Pick an example or write your own, and see the difference.
All systems go?
Let's make sure our systems are up and running.
Documentation
Get startedInstall the client and run a first function.GuidesTune calls, look up the SDK and its errors, and fix problems.ConceptsCold starts, checkpoints, sandboxes and sessions.ArchitectureThe router, workers, executor and pipeline, and how a call travels.ContributeSet up a development environment and run the stack.