serQ in Python: compile a program to its IR and run it, in process
Maintained. Last release 5 weeks ago, commits in 4 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install pyserqpyserq
serQ in Python. serQ is a language in which an LLM serving deployment is a
program; pyserq compiles a program to its IR and runs it, in process, and
gives what the serq CLI gives. A program is the deployment; the workload
it serves is a file of its own, given when it runs (workload= a path, or
workload_source= its text), as serq run mg1.sq --workload workloads/mg1.sq.
import pyserq
p = pyserq.compile("mg1.sq", workload="workloads/mg1.sq",
sets={"lam": 0.8}, seed=10, horizon=250000, warmup=25000)
r = pyserq.run(p) # the GIL is released while it runs
r.json() # what `serq run --json` prints
o = r.client["response"] # o.mean, o.ci, o.samples, o.times
pyserq.draw("mg1.sq", workload="workloads/mg1.sq", format="svg") # what `serq draw --format svg` prints
pip install pyserq # a release
pip install --pre pyserq # the latest commit on main (X.Y.Z.devN)
Wheels: linux x86_64 (manylinux), macOS arm64; Python 3.9 and later (abi3).
The version is serq's: pyserq.__version__ is the crate it was built from.