Skip to main content

Readie

Rapid code execution for Python via adaptive checkpointed environments

pip install readie

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.

Read about Readie's architecture

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 functionFinish

Restored from a checkpoint

  • Restore checkpoint
  • Run functionFinish
Illustrative proportions on one time scale, not measurements.

Try Readie

Pick an example or write your own, and see the difference.

main.py
Readie
Output appears here.
Cold start
Output appears here.