pllm
SDK

Python SDK

Plan models, compose research methods, and use supported PLLM runtimes from Python.

PLLM documentationView Markdown ↗

PLLM ships one Python package backed by Rust. The public API separates model planning from live runtime state so you can inspect and reproduce a plan without including credentials, masks, sessions, or model weights.

Choose an API

TaskStart hereResult
Declare a reproducible systemConfigurationImmutable Experiment input
Inspect model semanticsPlansImmutable ModelPlan and coverage
Select implementationsComponentsTyped capability composition
Compile executable regionsCompilerVerified native plan handles
Send native private requestsPython clientResponses and model resources
Measure and compareBenchmark and searchCohort-bound evidence and candidates
Operate provider rolesDeploy and operateExplicit client, preparation, and inference boundaries

Use the Python API reference for exact signatures; the authored pages above explain lifecycle, trust, and evidence constraints that a signature cannot express.

Install the package

Add the pllm.run distribution from PyPI to a uv project. It provides the pllm import package:

uv add pllm.run

Python SDK example

pllm.lower_model accepts model configuration and workload bounds. It returns an immutable semantic ModelPlan; it does not load a checkpoint or start an inference session.

from pllm import lower_model

config = {
    "model_type": "qwen2",
    "hidden_size": 64,
    "intermediate_size": 192,
    "num_hidden_layers": 2,
    "num_attention_heads": 4,
    "num_key_value_heads": 2,
    "vocab_size": 256,
    "max_position_embeddings": 128,
    "hidden_act": "silu",
    "rms_norm_eps": 1e-6,
    "rope_theta": 10000.0,
    "tie_word_embeddings": True,
}
plan = lower_model(config, batch=1, max_input_tokens=16, max_new_tokens=4)
assert plan.to_dict()["adapter"] == "pllm.qwen2.v1"
assert plan.prefill["output"] == "token_feedback"

API: Python SDK objects and signatures

Compose research methods

Apply a compatible component to a model plan to create a new plan with a record of the transformation. Compatibility with a semantic plan does not by itself establish compiler, runtime, privacy, quality, or deployment support.

Run supported workflows

Runtime APIs cover specific public-weight and confidential-weight workflows. Support depends on the model, protocol, operator set, deployment, and threat model. Check current support before choosing a path.

Continue

  • Python API reference lists the installed public objects.
  • Get started covers installation and the first inspection workflow.
  • OpenAI Python SDK connects the official client to the trusted local gateway.
  • Runtime explains live state and execution boundaries.
  • Models separates semantic planning from executable support.

Loading documentation index…

Search runs locally in this browser.