pllm Python API
Public objects, practical usage, and research context for pllm.
The root package is the task-oriented SDK surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths. Presence documents API availability, not complete model, security, or deployment coverage; check implementation status before relying on a path.
Modules
Every public module has its own executable reference page:
pllm.client- Client facades expose synchronous and asynchronous private-inference clients plus bounded response streams without requiring callers to import runtime internals.pllm.config- Immutable configuration records describe experiments before any checkpoint, network connection, credential, or one-use material is opened.pllm.models- Model APIs separate semantic architecture lowering from checkpoint import so a plan can be reviewed before weights or runtime state exist.pllm.native- Native APIs inspect the installed Rust backend and compile reusable integer matrix stages with explicit owned storage and conversion boundaries.pllm.plan- Plan records and locks bind semantic, numeric, privacy, and deployment decisions into immutable digest-addressed documents.pllm.components- The component registry discovers typed built-in capabilities by stable identity and creates concrete implementations only when explicitly requested.pllm.correlation- Correlation components describe offline cryptographic material sources independently from online protocol scheduling.pllm.kernels- Kernel components select bounded matrix implementations while preserving the compiler's numeric and placement contracts.pllm.metrics- Metric definitions attach units and optimization direction to measurements so evidence and Pareto search do not guess whether larger or smaller is better.pllm.nonlinear- Nonlinear components identify approximation or protected-evaluation methods separately from their scheduling strategy and executable coverage.pllm.official- Official integration factories construct OpenAI SDK clients that route requests through PLLM's trusted local client transport.pllm.passes- Graph passes transform semantic plans under explicit state and lifecycle contracts rather than rewriting adapter-specific operation names.pllm.profiles- Profiles provide reviewed slot-compatible pipeline presets while retaining the exact component identities used to compile an experiment.pllm.providers- Provider discovery reads package-confined static manifests without importing provider code; factory loading is a separate approved operation.pllm.research- The research registry exposes locked paper sources, clean-room method records, evidence requirements, and promotion assessments without executing quarantined upstream artifacts.pllm.protocols- Protocol components define which parties exchange which protected values and keep baseline masking separate from optional verification.pllm.protocols.masked_linear- Masked-linear records configure the public-weight prepared protocol and its optional trusted-client Freivalds verification contract.pllm.preparation- Preparation components define offline inventory production and trusted preparation roles without placing preparation work on the online inference path.pllm.roles- Role components make client, preparation, inference, and single-evaluator placement explicit in pipeline configuration.pllm.schedulers- Scheduler components state how independent protected lanes or scalar operations are ordered without changing the underlying method identity.pllm.search- Search APIs generate immutable experiment candidates and compare only cohort-compatible evidence with explicit metric directions.pllm.server- The server facade constructs the trusted client-boundary ASGI gateway with health, Responses API, and bounded runtime routes.pllm.sources- Source records identify model origins and bounded workloads without resolving files, downloading checkpoints, or opening runtime state.pllm.state- State components identify where persistent decoder state lives and keep mutable KV lifecycle out of immutable configuration records.pllm.verification- Verification components and checks bind optional result verification to explicit soundness and one-use material policies.pllm.pipeline- Pipeline records compose component identities into a digestible configuration while leaving live sessions, masks, and credentials outside the object graph.pllm.deployment- Deployment records describe role placement, endpoints, and trust boundaries without starting services or embedding credentials.pllm.runtime- Runtime APIs execute validated native kernels, bind compiled models, construct local role topologies, and expose trusted client-boundary services.pllm.compiler- The compiler accepts canonical request bytes, verifies complete capability coverage, and returns opaque native plans or fails closed.pllm.evidence- Evidence records preserve exact benchmark cohorts, environment identity, and assurance results without silently ranking incomparable runs.
Research context
This API is project infrastructure rather than an implementation of one specific paper. Relevant method pages link their primary sources separately.
Python SDK example
The example performs a bounded offline task and checks an observable result. It does not download a checkpoint or contact a provider.
import pllm
from pllm.kernels import Cpu
from pllm.profiles import MaskedLinearCpu
experiment = pllm.Experiment(
name="qwen-local",
pipeline=MaskedLinearCpu(
pllm.Model("Qwen/Qwen2.5-0.5B-Instruct"),
kernels=Cpu(threads=2),
),
deployment=pllm.Deployment.local(root=".pllm/qwen-local"),
budget=pllm.ExecutionBudget(requests=1, max_input_tokens=32, max_new_tokens=8),
)
assert len(pllm.configuration_digest(experiment)) == 64API: pllm
Objects and signatures
PROFILES
Maps each shipped profile ID to its immutable typed pipeline preset.
- Canonical object:
pllm.PROFILES - Kind:
dict - Signature/type:
dict - Public exports:
pllm.PROFILES
SECURE_PREVIEW
SECURE_PREVIEW is the predefined SecurityClaim value with name='secure_preview', input_confidentiality=True, output_confidentiality=True, model_confidentiality='malicious client', malicious_client_security=True, malicious_server_integrity=False, preprocessing_assumption='authenticated shares and multiplication material generated with HE; the model server follows the preprocessing protocol', reveals_intermediate_activations_to_client=False, output_disclosure='sampled token only by default, or final logits by explicit policy'.
- Canonical object:
pllm.SECURE_PREVIEW - Kind:
SecurityClaim - Signature/type:
SecurityClaim - Public exports:
pllm.SECURE_PREVIEW
__version__
Reports the installed PLLM distribution version.
- Canonical object:
pllm.__version__ - Kind:
str - Signature/type:
str - Public exports:
pllm.__version__
CompilationError
Raised when a Compilation condition prevents the requested operation from completing.
- Canonical object:
pllm.compiler.CompilationError - Kind:
class - Signature/type:
signature not exposed - Public exports:
pllm.CompilationError,pllm.compiler.CompilationError
compile
Compile one strict request into an immutable native plan.
- Canonical object:
pllm.compiler.compile - Kind:
function - Signature/type:
(request: 'Mapping[str, Any] \| bytes \| str') -> 'CompiledPlan' - Public exports:
pllm.compile,pllm.compiler.compile
ComponentRef
Immutable ComponentRef record carrying component, params for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.configuration.ComponentRef - Kind:
class - Signature/type:
__init__(self, component: str, params: Mapping[str, Any] \| None=None) -> None - Public exports:
pllm.ComponentRef,pllm.components.ComponentRef,pllm.config.ComponentRef - Public members:
component: str;params: Mapping[str, Any];__init__(self, component: str, params: Mapping[str, Any] \| None=None) -> None;classmethod from_params(cls, params: Mapping[str, Any]) -> ComponentRef;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> Self;to_spec(self) -> dict[str, Any]
ConfigurationError
Raised when a Configuration condition prevents the requested operation from completing.
- Canonical object:
pllm.configuration.ConfigurationError - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.ConfigurationError,pllm.config.ConfigurationError
Deployment
Immutable Deployment record carrying kind, root for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.configuration.Deployment - Kind:
class - Signature/type:
__init__(self, kind: str, root: str) -> None - Public exports:
pllm.Deployment,pllm.config.Deployment,pllm.deployment.Deployment - Public members:
kind: str;root: str;__init__(self, kind: str, root: str) -> None;classmethod local(cls, *, root: str) -> Self;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> Self;to_spec(self) -> dict[str, Any]
ExecutionBudget
Immutable ExecutionBudget record carrying requests, max_input_tokens, max_new_tokens for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.configuration.ExecutionBudget - Kind:
class - Signature/type:
__init__(self, requests: int, max_input_tokens: int, max_new_tokens: int) -> None - Public exports:
pllm.ExecutionBudget,pllm.config.ExecutionBudget,pllm.runtime.ExecutionBudget - Public members:
requests: int;max_input_tokens: int;max_new_tokens: int;__init__(self, requests: int, max_input_tokens: int, max_new_tokens: int) -> None;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> Self;to_spec(self) -> dict[str, Any]
Experiment
Immutable Experiment record carrying name, pipeline, deployment, budget for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.configuration.Experiment - Kind:
class - Signature/type:
__init__(self, name: str, pipeline: Pipeline, deployment: Deployment, budget: ExecutionBudget) -> None - Public exports:
pllm.Experiment,pllm.config.Experiment,pllm.pipeline.Experiment - Public members:
name: str;pipeline: Pipeline;deployment: Deployment;budget: ExecutionBudget;__init__(self, name: str, pipeline: Pipeline, deployment: Deployment, budget: ExecutionBudget) -> None;classmethod from_spec(cls, spec: Mapping[str, Any], *, providers: Iterable[ProviderDescriptor]=...) -> Self;classmethod from_file(cls, path: str \| Path, *, providers: Iterable[ProviderDescriptor]=...) -> Self;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> Self;to_spec(self) -> dict[str, Any];canonical_bytes(self) -> bytes;configuration_digest(self) -> str;resolve(self) -> ExperimentProfile
ExperimentProfile
Immutable runtime resolution of one component composition.
- Canonical object:
pllm.configuration.ExperimentProfile - Kind:
class - Signature/type:
__init__(self, experiment: Experiment) -> None - Public exports:
pllm.ExperimentProfile,pllm.config.ExperimentProfile - Public members:
model: str;canonical_composition: bytes;composition_digest: str;configuration_digest: str;profile: str \| None;privacy_mode: str;proprietary_protocol: str;requires_preparation: bool;client_runtime: str;privacy_protocol: str \| None;verification_component: str \| None;verification_target_failure_bits: int;__init__(self, experiment: Experiment) -> None
Model
Immutable Model record carrying source, kind, model_id, revision, local_files_only, endpoint for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.configuration.Model - Kind:
class - Signature/type:
__init__(self, source: str, *, kind: str='huggingface', model_id: str \| None=None, revision: str \| None=None, local_files_only: bool=False, endpoint: str \| None=None) -> None - Public exports:
pllm.Model,pllm.config.Model - Public members:
source: str;kind: str;model_id: str \| None;revision: str \| None;local_files_only: bool;endpoint: str \| None;__init__(self, source: str, *, kind: str='huggingface', model_id: str \| None=None, revision: str \| None=None, local_files_only: bool=False, endpoint: str \| None=None) -> None;classmethod hf(cls, repo_id: str, *, model_id: str \| None=None, revision: str \| None=None, local_files_only: bool=False) -> Model;classmethod path(cls, path: str, *, format: str='huggingface', model_id: str \| None=None) -> Model;classmethod tiny(cls, name: str='qwen2', *, model_id: str \| None=None) -> Model;classmethod ollama(cls, name: str, *, endpoint: str='http://127.0.0.1:11434', model_id: str \| None=None) -> Model;classmethod from_spec(cls, value: Mapping[str, Any]) -> Model;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> Self;to_spec(self) -> dict[str, Any];canonical_bytes(self) -> bytes;digest(self) -> str;to_runtime_spec(self) -> dict[str, Any]
Pipeline
Immutable Pipeline record carrying model, components, profile for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.configuration.Pipeline - Kind:
class - Signature/type:
__init__(self, model: Model, components: Mapping[str, ComponentRef], profile: str \| None=...) -> None - Public exports:
pllm.Pipeline,pllm.config.Pipeline,pllm.pipeline.Pipeline - Public members:
model: Model;components: Mapping[str, ComponentRef];profile: str \| None;__init__(self, model: Model, components: Mapping[str, ComponentRef], profile: str \| None=...) -> None;classmethod from_profile(cls, profile: str, *, model: Model, components: Mapping[str, ComponentRef]) -> Self;classmethod from_spec(cls, value: Mapping[str, Any], *, providers: Iterable[ProviderDescriptor]=...) -> Pipeline;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> Self;to_spec(self) -> dict[str, Any];canonical_bytes(self) -> bytes;digest(self) -> str
canonical_bytes
Return deterministic UTF-8 JSON bytes for a supported public specification.
- Canonical object:
pllm.configuration.canonical_bytes - Kind:
function - Signature/type:
canonical_bytes(configuration: Experiment \| Mapping[str, Any], *, providers: Iterable[ProviderDescriptor]=...) -> bytes - Public exports:
pllm.canonical_bytes,pllm.config.canonical_bytes
configuration_digest
Return domain-separated SHA-256 identity for public configuration.
- Canonical object:
pllm.configuration.configuration_digest - Kind:
function - Signature/type:
configuration_digest(configuration: Experiment \| Mapping[str, Any], *, providers: Iterable[ProviderDescriptor]=...) -> str - Public exports:
pllm.config.configuration_digest,pllm.configuration_digest
load_configuration
Read and parse one experiment file; constructors themselves perform no I/O.
- Canonical object:
pllm.configuration.load_configuration - Kind:
function - Signature/type:
load_configuration(path: str \| Path, *, providers: Iterable[ProviderDescriptor]=...) -> Experiment - Public exports:
pllm.config.load_configuration,pllm.load_configuration
loads_configuration
Parse one strict JSON or safe YAML experiment document.
- Canonical object:
pllm.configuration.loads_configuration - Kind:
function - Signature/type:
loads_configuration(text: str, *, format: str \| None=None, providers: Iterable[ProviderDescriptor]=...) -> Experiment - Public exports:
pllm.config.loads_configuration,pllm.loads_configuration
BenchmarkResult
Opaque immutable BenchmarkResult record created by its public factories for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.evidence.BenchmarkResult - Kind:
class - Signature/type:
not publicly constructible - Public exports:
pllm.BenchmarkResult,pllm.evidence.BenchmarkResult - Public members:
canonical_bytes(self) -> 'bytes';classmethod from_dict(cls, document: 'Mapping[str, Any]') -> 'BenchmarkResult';property data: 'Mapping[str, Any]';property digest: 'str';property id: 'str';to_dict(self) -> 'dict[str, Any]'
EvidenceRegistry
Opaque immutable EvidenceRegistry record created by its public factories for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.evidence.EvidenceRegistry - Kind:
class - Signature/type:
(results: 'Iterable[BenchmarkResult]' = ()) -> 'None' - Public exports:
pllm.EvidenceRegistry,pllm.evidence.EvidenceRegistry - Public members:
get(self, identity: 'str') -> 'BenchmarkResult';list(self) -> 'tuple[BenchmarkResult, ...]';query(self, *, profile: 'str \| None' = None, component: 'str \| None' = None, model: 'str \| None' = None, environment_digest: 'str \| None' = None, privacy_cohort: 'str \| None' = None, numeric_cohort: 'str \| None' = None, metric: 'str \| None' = None, status: 'str \| None' = None) -> 'tuple[BenchmarkResult, ...]';register(self, result: 'BenchmarkResult') -> 'EvidenceRegistry'
EvidenceReport
Immutable, canonical benchmark or assurance evidence.
- Canonical object:
pllm.evidence.EvidenceReport - Kind:
class - Signature/type:
not publicly constructible - Public exports:
pllm.EvidenceReport,pllm.evidence.EvidenceReport - Public members:
canonical_bytes(self) -> 'bytes';property data: 'Mapping[str, Any]';property schema_version: 'str';to_dict(self) -> 'dict[str, Any]'
assure
Run deterministic native assurance fixtures, including negative controls.
- Canonical object:
pllm.evidence.assure - Kind:
function - Signature/type:
() -> 'EvidenceReport' - Public exports:
pllm.assure,pllm.evidence.assure
benchmark
Benchmark one native compiled region against its scalar oracle.
- Canonical object:
pllm.evidence.benchmark - Kind:
function - Signature/type:
(plan: 'CompiledPlan', *, weights: 'bytes', input: 'bytes', id: 'str', privacy_cohort: 'str', numeric_cohort: 'str', environment: 'Mapping[str, Any]', warmups: 'int' = 3, repetitions: 'int' = 10, threads: 'int' = 1, simd: 'bool' = True) -> 'EvidenceReport' - Public exports:
pllm.benchmark,pllm.evidence.benchmark
deployment_benchmark
Validate deployment observations and return canonical benchmark evidence.
- Canonical object:
pllm.evidence.deployment_benchmark - Kind:
function - Signature/type:
(request: 'Mapping[str, Any]') -> 'EvidenceReport' - Public exports:
pllm.deployment_benchmark,pllm.evidence.deployment_benchmark
environment_digest
Computes a deterministic digest for the exact benchmark environment record.
- Canonical object:
pllm.evidence.environment_digest - Kind:
function - Signature/type:
(attributes: 'Mapping[str, Any]') -> 'str' - Public exports:
pllm.environment_digest,pllm.evidence.environment_digest
Cpu
Selects component pllm/cpu during compilation; it provides cpu for roles client, preparation, inference.
- Canonical object:
pllm.kernels.Cpu - Kind:
class - Signature/type:
__init__(self, *, threads: int=1) -> None - Public exports:
pllm.Cpu,pllm.kernels.Cpu - Public members:
descriptor: ComponentDescriptor;__init__(self, *, threads: int=1) -> None;classmethod describe(cls) -> ComponentDescriptor
load_model
Resolves and imports a model source while recording path-independent checkpoint hashes.
- Canonical object:
pllm.model_loader.load_model - Kind:
function - Signature/type:
load_model(value: Model \| str \| Mapping[str, Any], *, token: str \| bool \| None=None, cache_dir: str \| Path \| None=None, api_key: str \| None=None) -> ModelManifest - Public exports:
pllm.load_model,pllm.models.load_model
DecoderCoverageReport
Compiler coverage that distinguishes primitives from executable operators.
- Canonical object:
pllm.modeling.DecoderCoverageReport - Kind:
class - Signature/type:
not publicly constructible - Public exports:
pllm.DecoderCoverageReport,pllm.models.DecoderCoverageReport - Public members:
canonical_bytes(self) -> 'bytes';property complete: 'bool';property operators: 'tuple[Mapping[str, Any], ...]';to_dict(self) -> 'dict[str, Any]'
DecoderRuntimeSchedule
Opaque immutable DecoderRuntimeSchedule record created by its public factories for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.modeling.DecoderRuntimeSchedule - Kind:
class - Signature/type:
not publicly constructible - Public exports:
pllm.DecoderRuntimeSchedule,pllm.models.DecoderRuntimeSchedule - Public members:
canonical_bytes(self) -> 'bytes';property complete: 'bool';property composition_digest: 'str';property decode: 'Mapping[str, Any]';property digest: 'str';property prefill: 'Mapping[str, Any]';property protected_execution: 'bool';to_dict(self) -> 'dict[str, Any]'
ModelPlan
Immutable bounded semantic graph produced by a model-family adapter.
- Canonical object:
pllm.modeling.ModelPlan - Kind:
class - Signature/type:
not publicly constructible - Public exports:
pllm.ModelPlan,pllm.models.ModelPlan - Public members:
apply(self, component: "'ComponentRef'") -> "'ModelPlan'";canonical_bytes(self) -> 'bytes';coverage(self, composition: "'Pipeline \| None'" = None) -> "'DecoderCoverageReport'";property decode: 'Mapping[str, Any]';property digest: 'str';property prefill: 'Mapping[str, Any]';runtime_schedule(self, composition: "'Pipeline'") -> "'DecoderRuntimeSchedule'";to_dict(self) -> 'dict[str, Any]'
lower_model
Lower a supported Hugging Face model config without loading weights.
- Canonical object:
pllm.modeling.lower_model - Kind:
function - Signature/type:
(config: 'Mapping[str, Any] \| bytes \| str', *, batch: 'int', max_input_tokens: 'int', max_new_tokens: 'int') -> 'ModelPlan' - Public exports:
pllm.lower_model,pllm.models.lower_model
KvCacheEviction
Selects component pllm/kv-cache-eviction during model-lowering; it provides bounded-kv-cache-eviction.
- Canonical object:
pllm.passes.KvCacheEviction - Kind:
class - Signature/type:
__init__(self, *, implementation: str='pllm/importance-kv-cache-eviction/v1', observation_window: tuple[int, int] \| Mapping[str, int]=(1, 5), static_keep: tuple[int, int] \| Mapping[str, int]=(3, 10), dynamic_keep: tuple[int, int] \| Mapping[str, int]=(1, 4), alpha: tuple[int, int] \| Mapping[str, int]=(3, 5), cluster_sizes: Sequence[int]=(32, 16), share_adjacent_layers: bool=True) -> None - Public exports:
pllm.KvCacheEviction,pllm.passes.KvCacheEviction - Public members:
descriptor: ComponentDescriptor;__init__(self, *, implementation: str='pllm/importance-kv-cache-eviction/v1', observation_window: tuple[int, int] \| Mapping[str, int]=(1, 5), static_keep: tuple[int, int] \| Mapping[str, int]=(3, 10), dynamic_keep: tuple[int, int] \| Mapping[str, int]=(1, 4), alpha: tuple[int, int] \| Mapping[str, int]=(3, 5), cluster_sizes: Sequence[int]=(32, 16), share_adjacent_layers: bool=True) -> None;classmethod describe(cls) -> ComponentDescriptor
CompiledPlan
Opaque compiled plan exposing records but no execution methods.
- Canonical object:
pllm.plan.CompiledPlan - Kind:
class - Signature/type:
not publicly constructible - Public exports:
pllm.CompiledPlan,pllm.plan.CompiledPlan - Public members:
__new__(cls) -> Never;property logical_plan: bytes;property execution_plan: bytes;property plan_lock: bytes;property region_program: bytes;property configuration_digest: str;property logical_plan_digest: str;property execution_plan_digest: str;property plan_lock_digest: str;property input_shape: tuple[int, ...];property output_shape: tuple[int, ...]
ModelAwareCorrections
Selects component pllm/model-aware-corrections during preparation; it provides one-use-masked-linear-corrections for roles preparation.
- Canonical object:
pllm.preparation.ModelAwareCorrections - Kind:
class - Signature/type:
__init__(self) -> None - Public exports:
pllm.ModelAwareCorrections,pllm.preparation.ModelAwareCorrections - Public members:
descriptor: ComponentDescriptor;__init__(self) -> None;classmethod describe(cls) -> ComponentDescriptor
DirectFHEProfile
Pipeline(model: 'Model', components: 'Mapping[str, ComponentRef]', profile: 'str | None' = None).
- Canonical object:
pllm.profiles.DirectFHEProfile - Kind:
class - Signature/type:
__init__(self, model: ModelSource, *, linear: DirectFHE=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None - Public exports:
pllm.DirectFHEProfile,pllm.pipeline.DirectFHEProfile,pllm.profiles.DirectFHEProfile - Public members:
PROFILE: str;__init__(self, model: ModelSource, *, linear: DirectFHE=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None;property linear: DirectFHE;property inference: InferenceRole;property kernels: KernelBackend;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> DirectFHEProfile
MaskedLinearCpu
Pipeline(model: 'Model', components: 'Mapping[str, ComponentRef]', profile: 'str | None' = None).
- Canonical object:
pllm.profiles.MaskedLinearCpu - Kind:
class - Signature/type:
__init__(self, model: ModelSource, *, linear: ProtocolMethod=..., preparation: PreparationProvider=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None - Public exports:
pllm.MaskedLinearCpu,pllm.pipeline.MaskedLinearCpu,pllm.profiles.MaskedLinearCpu - Public members:
PROFILE: str;__init__(self, model: ModelSource, *, linear: ProtocolMethod=..., preparation: PreparationProvider=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None;property linear: ProtocolMethod;property preparation: PreparationProvider;property inference: InferenceRole;property kernels: KernelBackend;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> MaskedLinearCpu
ProprietaryBlinded
Pipeline(model: 'Model', components: 'Mapping[str, ComponentRef]', profile: 'str | None' = None).
- Canonical object:
pllm.profiles.ProprietaryBlinded - Kind:
class - Signature/type:
__init__(self, model: ModelSource, *, linear: BlindedLinear=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None - Public exports:
pllm.ProprietaryBlinded,pllm.pipeline.ProprietaryBlinded,pllm.profiles.ProprietaryBlinded - Public members:
PROFILE: str;__init__(self, model: ModelSource, *, linear: BlindedLinear=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None;property linear: BlindedLinear;property inference: InferenceRole;property kernels: KernelBackend;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> ProprietaryBlinded
ProprietaryGuarded
Pipeline(model: 'Model', components: 'Mapping[str, ComponentRef]', profile: 'str | None' = None).
- Canonical object:
pllm.profiles.ProprietaryGuarded - Kind:
class - Signature/type:
__init__(self, model: ModelSource, *, linear: GuardedLinear=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None - Public exports:
pllm.ProprietaryGuarded,pllm.pipeline.ProprietaryGuarded,pllm.profiles.ProprietaryGuarded - Public members:
PROFILE: str;__init__(self, model: ModelSource, *, linear: GuardedLinear=..., inference: InferenceRole=..., kernels: KernelBackend=...) -> None;property linear: GuardedLinear;property inference: InferenceRole;property kernels: KernelBackend;get_params(self, deep: bool=True) -> dict[str, Any];with_params(self, **changes: object) -> ProprietaryGuarded
VerifiedMaskedLinearCpu
Pipeline(model: 'Model', components: 'Mapping[str, ComponentRef]', profile: 'str | None' = None).
- Canonical object:
pllm.profiles.VerifiedMaskedLinearCpu - Kind:
class - Signature/type:
__init__(self, model: ModelSource, *, linear: ProtocolMethod=..., preparation: PreparationProvider=..., inference: InferenceRole=..., kernels: KernelBackend=..., verification: VerificationScheme=...) -> None - Public exports:
pllm.VerifiedMaskedLinearCpu,pllm.pipeline.VerifiedMaskedLinearCpu,pllm.profiles.VerifiedMaskedLinearCpu - Public members:
PROFILE: str;__init__(self, model: ModelSource, *, linear: ProtocolMethod=..., preparation: PreparationProvider=..., inference: InferenceRole=..., kernels: KernelBackend=..., verification: VerificationScheme=...) -> None;property linear: ProtocolMethod;property preparation: PreparationProvider;property inference: InferenceRole;property kernels: KernelBackend;property verification: FreivaldsVerify;with_params(self, **changes: object) -> VerifiedMaskedLinearCpu
MaskedLinear
Selects component pllm/masked-linear during compilation; it provides masked-linear for roles client, preparation, inference.
- Canonical object:
pllm.protocols.masked_linear.MaskedLinear - Kind:
class - Signature/type:
__init__(self) -> None - Public exports:
pllm.MaskedLinear,pllm.protocols.MaskedLinear,pllm.protocols.masked_linear.MaskedLinear - Public members:
descriptor: ComponentDescriptor;__init__(self) -> None;classmethod describe(cls) -> ComponentDescriptor
ProviderDescriptor
Immutable ProviderDescriptor record carrying provider, distribution, version, host_versions, category_versions, components, schemas, docs, native_artifacts, python_factories, tested_builds, entry_point, manifest_digest, editable, component_classes for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.providers.ProviderDescriptor - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.ProviderDescriptor,pllm.providers.ProviderDescriptor - Public members:
provider: str;distribution: str;version: str;host_versions: tuple[str, ...];category_versions: Mapping[str, tuple[str, ...]];components: tuple[ComponentDescriptor, ...];schemas: tuple[ProviderResource, ...];docs: tuple[ProviderResource, ...];native_artifacts: tuple[ProviderResource, ...];python_factories: Mapping[str, str];tested_builds: tuple[Mapping[str, Any], ...];entry_point: str;manifest_digest: str;editable: bool;component_classes: tuple[type[ComponentRef], ...];to_dict(self) -> dict[str, Any]
ProviderDiscoveryError
Raised when a ProviderDiscovery condition prevents the requested operation from completing.
- Canonical object:
pllm.providers.ProviderDiscoveryError - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.ProviderDiscoveryError,pllm.providers.ProviderDiscoveryError
ProviderResource
Immutable ProviderResource record carrying path, sha256, abi_version, targets for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.providers.ProviderResource - Kind:
class - Signature/type:
__init__(self, path: str, sha256: str, abi_version: str \| None=None, targets: tuple[str, ...]=()) -> None - Public exports:
pllm.ProviderResource,pllm.providers.ProviderResource - Public members:
path: str;sha256: str;abi_version: str \| None;targets: tuple[str, ...];__init__(self, path: str, sha256: str, abi_version: str \| None=None, targets: tuple[str, ...]=()) -> None;to_dict(self) -> dict[str, Any]
discover_providers
Discovers static provider manifests without importing provider implementation code.
- Canonical object:
pllm.providers.discover_providers - Kind:
function - Signature/type:
discover_providers(*, entry_points: Iterable[Any] \| None=None, allow_editable: bool=False, host_version: str=HOST_COMPONENT_STANDARD_VERSION) -> tuple[ProviderDescriptor, ...] - Public exports:
pllm.discover_providers,pllm.providers.discover_providers
load_component_factory
Performs the load component factory operation for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.providers.load_component_factory - Kind:
function - Signature/type:
load_component_factory(provider: ProviderDescriptor, component: str, *, approved_providers: Collection[str]) -> Any - Public exports:
pllm.load_component_factory,pllm.providers.load_component_factory
ArtifactLock
Immutable ArtifactLock record carrying id, source_record_id, revision, artifact_digest, license_review, isolation, repository_url, status, evidence_digest for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.research.ArtifactLock - Kind:
class - Signature/type:
__init__(self, id: str, source_record_id: str, revision: str, artifact_digest: str \| None, license_review: str, isolation: str, repository_url: str \| None=None, status: str='quarantined', evidence_digest: str \| None=None) -> None - Public exports:
pllm.ArtifactLock,pllm.research.ArtifactLock - Public members:
id: str;source_record_id: str;revision: str;artifact_digest: str \| None;license_review: str;isolation: str;repository_url: str \| None;status: str;evidence_digest: str \| None;__init__(self, id: str, source_record_id: str, revision: str, artifact_digest: str \| None, license_review: str, isolation: str, repository_url: str \| None=None, status: str='quarantined', evidence_digest: str \| None=None) -> None;property digest: str;canonical_bytes(self) -> bytes;to_dict(self) -> dict[str, Any];classmethod from_dict(cls, document: Mapping[str, Any]) -> ArtifactLock;lock_artifact(self, *, artifact_digest: str) -> ArtifactLock;verify(self, *, evidence_digest: str) -> ArtifactLock;reject(self, *, evidence_digest: str) -> ArtifactLock
MethodRecord
Opaque immutable MethodRecord record created by its public factories for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.research.MethodRecord - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.MethodRecord,pllm.research.MethodRecord - Public members:
classmethod from_dict(cls, document: Mapping[str, Any]) -> MethodRecord;property id: str;property digest: str;canonical_bytes(self) -> bytes;to_dict(self) -> dict[str, Any]
PromotionDecision
Immutable PromotionDecision record carrying method_id, eligible, blockers for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.research.PromotionDecision - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.PromotionDecision,pllm.research.PromotionDecision - Public members:
method_id: str;eligible: bool;blockers: tuple[str, ...]
ResearchRegistry
Opaque immutable ResearchRegistry record created by its public factories for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.research.ResearchRegistry - Kind:
class - Signature/type:
__init__(self, *, sources: Iterable[SourceRecord]=..., methods: Iterable[MethodRecord]=..., artifacts: Iterable[ArtifactLock]=...) -> None - Public exports:
pllm.ResearchRegistry,pllm.research.ResearchRegistry - Public members:
__init__(self, *, sources: Iterable[SourceRecord]=..., methods: Iterable[MethodRecord]=..., artifacts: Iterable[ArtifactLock]=...) -> None;sources(self) -> tuple[SourceRecord, ...];methods(self) -> tuple[MethodRecord, ...];artifacts(self) -> tuple[ArtifactLock, ...];source(self, identity: str) -> SourceRecord;method(self, identity: str) -> MethodRecord;artifact(self, identity: str) -> ArtifactLock;promotion(self, method_id: str) -> PromotionDecision
SourceRecord
Opaque immutable SourceRecord record created by its public factories for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.research.SourceRecord - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.SourceRecord,pllm.research.SourceRecord - Public members:
classmethod from_dict(cls, document: Mapping[str, Any]) -> SourceRecord;property id: str;property digest: str;canonical_bytes(self) -> bytes;to_dict(self) -> dict[str, Any]
AuthenticatedMPC
Arithmetic simulator with both parties' shares in one process.
- Canonical object:
pllm.runtime.authenticated_mpc.AuthenticatedMPC - Kind:
class - Signature/type:
(preprocessor: 'TrustedPreprocessor') -> 'None' - Public exports:
pllm.AuthenticatedMPC - Public members:
add(self, left: 'AuthenticatedValue', right: 'AuthenticatedValue') -> 'AuthenticatedValue';add_public(self, value: 'AuthenticatedValue', clear: 'int \| np.ndarray') -> 'AuthenticatedValue';broadcast_to(self, value: 'AuthenticatedValue', shape: 'Sequence[int]') -> 'AuthenticatedValue';centered(self, value: 'np.ndarray') -> 'np.ndarray';concatenate(self, values: 'Sequence[AuthenticatedValue]', axis: 'int' = 0) -> 'AuthenticatedValue';input(self, clear: 'np.ndarray', mask: 'InputMask') -> 'AuthenticatedValue';linear(self, value: 'AuthenticatedValue', weight: 'np.ndarray', correlation: 'LinearCorrelation') -> 'AuthenticatedValue';linear_many(self, values: 'Sequence[AuthenticatedValue]', weights: 'Sequence[np.ndarray]', correlations: 'Sequence[LinearCorrelation]') -> 'list[AuthenticatedValue]';linear_public(self, value: 'AuthenticatedValue', weight: 'np.ndarray') -> 'AuthenticatedValue';mul_public(self, value: 'AuthenticatedValue', clear: 'int \| np.ndarray') -> 'AuthenticatedValue';multiply(self, left: 'AuthenticatedValue', right: 'AuthenticatedValue', triple: 'MultiplicationTriple') -> 'AuthenticatedValue';multiply_many(self, left_values: 'Sequence[AuthenticatedValue]', right_values: 'Sequence[AuthenticatedValue]', triples: 'Sequence[MultiplicationTriple]') -> 'list[AuthenticatedValue]';open(self, value: 'AuthenticatedValue', *, to_client: 'bool' = True) -> 'np.ndarray';open_many(self, values: 'Sequence[AuthenticatedValue]', *, to_client: 'bool' = True, count_round: 'bool' = True) -> 'list[np.ndarray]';polynomial(self, value: 'AuthenticatedValue', coefficients: 'Sequence[int]', triples: 'Iterable[MultiplicationTriple]') -> 'AuthenticatedValue';public_value(self, clear: 'int \| np.ndarray', shape: 'Sequence[int] \| None' = None) -> 'AuthenticatedValue';reshape(self, value: 'AuthenticatedValue', shape: 'Sequence[int]') -> 'AuthenticatedValue';square(self, value: 'AuthenticatedValue', triple: 'MultiplicationTriple') -> 'AuthenticatedValue';sub(self, left: 'AuthenticatedValue', right: 'AuthenticatedValue') -> 'AuthenticatedValue';sum(self, value: 'AuthenticatedValue', axis=None, keepdims: 'bool' = False) -> 'AuthenticatedValue';take(self, value: 'AuthenticatedValue', key) -> 'AuthenticatedValue';transpose(self, value: 'AuthenticatedValue', axes: 'Sequence[int]') -> 'AuthenticatedValue'
AuthenticationError
Raised when a Authentication condition prevents the requested operation from completing.
- Canonical object:
pllm.runtime.authenticated_mpc.AuthenticationError - Kind:
class - Signature/type:
signature not exposed - Public exports:
pllm.AuthenticationError
TrustedPreprocessor
Reference source for authenticated preprocessing material.
- Canonical object:
pllm.runtime.authenticated_mpc.TrustedPreprocessor - Kind:
class - Signature/type:
(*, modulus: 'int' = 65537, alpha: 'int \| None' = None, seed: 'int \| None' = None) -> 'None' - Public exports:
pllm.TrustedPreprocessor - Public members:
bit_mask(self, shape: 'Sequence[int]', bit_width: 'int \| None' = None) -> 'BitDecompositionMask';input_mask(self, shape: 'Sequence[int]') -> 'InputMask';linear_correlation(self, weight: 'np.ndarray', input_shape: 'Sequence[int]') -> 'LinearCorrelation';multiplication_triple(self, shape: 'Sequence[int]') -> 'MultiplicationTriple';random(self, shape: 'Sequence[int]') -> 'np.ndarray';share(self, clear: 'np.ndarray \| Sequence[int] \| int') -> 'AuthenticatedValue'
BlindedTransformerEngine
Fast proprietary-weight mode using output-blinded HE preprocessing.
- Canonical object:
pllm.runtime.blinded_engine.BlindedTransformerEngine - Kind:
class - Signature/type:
(*args: 'Any', **kwargs: 'Any') -> 'None' - Public exports:
pllm.BlindedTransformerEngine - Public members:
client_bundle(self, model_id: 'str', *, include_local_weights: 'bool' = False) -> 'bytes';create_local_blinded_correlations(self, model_id: 'str', stage_id: 'str', owner_id: 'str', count: 'int', *, seed: 'int \| None' = None) -> 'list[BlindedStageCorrelation]';create_local_correlations(self, *args: 'Any', **kwargs: 'Any');evaluate_bfv_blinded_correlation(self, model_id: 'str', stage_id: 'str', owner_id: 'str', context_id: 'str', encrypted_mask: 'bytes') -> 'bytes';evaluate_bfv_blinded_correlations(self, model_id: 'str', stage_id: 'str', owner_id: 'str', context_id: 'str', encrypted_masks: 'list[bytes]') -> 'list[bytes]';evaluate_bfv_correlation(self, *args: 'Any', **kwargs: 'Any');evaluate_bfv_correlations(self, *args: 'Any', **kwargs: 'Any');execute_stage(self, model_id: 'str', stage: 'StageSpec', payloads: 'list[bytes]') -> 'list[bytes]';load(self, manifest: 'ModelManifest') -> 'None';proprietary_inventory_stats(self) -> 'dict[str, int]'
AsyncOpenAI
Asynchronous OpenAI-compatible client that targets the trusted local PLLM gateway.
- Canonical object:
pllm.runtime.client.AsyncOpenAI - Kind:
class - Signature/type:
(**kwargs: 'Any') -> 'None' - Public exports:
pllm.AsyncOpenAI,pllm.client.AsyncOpenAI,pllm.runtime.AsyncOpenAI - Public members:
close(self) -> 'None';prepared_rows_for_response(self, input: 'str', max_output_tokens: 'int', *, model: 'str \| None' = None, instructions: 'str \| None' = None) -> 'int';preprocess(self, model: 'str \| None' = None, *, count: 'int \| None' = None, stages: 'list[str] \| None' = None) -> 'dict[str, Any]';property privacy_audit: 'PrivacyAudit'
OpenAI
Synchronous OpenAI-compatible client that targets the trusted local PLLM gateway.
- Canonical object:
pllm.runtime.client.OpenAI - Kind:
class - Signature/type:
(*, api_key: 'str \| None' = None, base_url: 'str \| None' = None, default_model: 'str \| None' = None, model: 'str \| None' = None, session_transport: 'str \| None' = None, correlation_mode: 'str \| None' = None, preparation_base_url: 'str \| None' = None, preparation_api_key: 'str \| None' = None, correlation_prefetch: 'int \| None' = None, prepared_inventory_rows: 'int \| None' = None, background_inventory_refill: 'bool' = True, token_cache_size: 'int \| None' = None, bundle_cache_mode: 'str \| None' = None, bundle_cache_dir: 'str \| Path \| None' = None, tenseal_path: 'str \| None' = None, timeout: 'float \| None' = None, http_client: 'httpx.Client \| None' = None, preparation_http_client: 'httpx.Client \| None' = None, experiment: 'Experiment \| ExperimentProfile \| None' = None) -> 'None' - Public exports:
pllm.OpenAI,pllm.client.OpenAI,pllm.runtime.OpenAI - Public members:
close(self) -> 'None';prepared_inventory_status(self, model: 'str \| None' = None) -> 'dict[str, Any]';prepared_rows_for_response(self, input: 'str', max_output_tokens: 'int', *, model: 'str \| None' = None, instructions: 'str \| None' = None) -> 'int';preprocess(self, model: 'str \| None' = None, *, count: 'int \| None' = None, stages: 'list[str] \| None' = None) -> 'dict[str, Any]';property privacy_audit: 'PrivacyAudit'
ResponseStream
Abstract base class for generic types.
- Canonical object:
pllm.runtime.client.ResponseStream - Kind:
class - Signature/type:
(iterator: 'Iterator[T]', close: 'Callable[[], None] \| None' = None) -> 'None' - Public exports:
pllm.ResponseStream,pllm.client.ResponseStream - Public members:
close(self) -> 'None'
GatewayConfig
Immutable GatewayConfig record carrying api_keys, privacy_mode, proprietary_protocol, backends, engine_models, max_batch_size, max_batch_wait_ms, adaptive_batching, response_retention_seconds, provider_push_api_key, rendezvous_timeout_seconds, rendezvous_capacity, rendezvous_max_bytes, rendezvous_max_attempts_per_session, prepared_session_capacity, prepared_session_idle_seconds, preparation_request_max_bytes, prepared_payload_max_bytes, prepared_tensor_max_elements, prepared_stage_batch_rows, preparation_inference_url, preparation_push_api_key, preparation_push_timeout_seconds, allow_insecure_local_correlations, tenseal_path, reference_model_id, reference_phrase, reference_alphabet for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.config.GatewayConfig - Kind:
class - Signature/type:
(api_keys: 'tuple[str, ...]' = ('pllm-local',), privacy_mode: 'str' = 'public', proprietary_protocol: 'str' = 'guarded', backends: 'tuple[dict[str, Any], ...]' = (), engine_models: 'tuple[dict[str, Any], ...]' = (), max_batch_size: 'int' = 32, max_batch_wait_ms: 'float' = 0.25, adaptive_batching: 'bool' = True, response_retention_seconds: 'float' = 3600.0, provider_push_api_key: 'str \| None' = None, rendezvous_timeout_seconds: 'float' = 30.0, rendezvous_capacity: 'int' = 32768, rendezvous_max_bytes: 'int' = 268435456, rendezvous_max_attempts_per_session: 'int' = 33554432, prepared_session_capacity: 'int' = 4096, prepared_session_idle_seconds: 'float' = 300.0, preparation_request_max_bytes: 'int' = 16384, prepared_payload_max_bytes: 'int' = 268435456, prepared_tensor_max_elements: 'int' = 67108864, prepared_stage_batch_rows: 'int' = 4096, preparation_inference_url: 'str \| None' = None, preparation_push_api_key: 'str \| None' = None, preparation_push_timeout_seconds: 'float' = 10.0, allow_insecure_local_correlations: 'bool' = False, tenseal_path: 'str \| None' = None, reference_model_id: 'str' = 'pllm-bigram-demo', reference_phrase: 'str' = 'private\n', reference_alphabet: 'str' = 'private\\n') -> None - Public exports:
pllm.GatewayConfig,pllm.runtime.GatewayConfig - Public members:
classmethod from_dict(cls, value: 'dict[str, Any]') -> "'GatewayConfig'";classmethod load(cls, path: 'str \| Path') -> "'GatewayConfig'";to_dict(self) -> 'dict[str, Any]'
SecurityClaim
Immutable SecurityClaim record carrying name, input_confidentiality, output_confidentiality, model_confidentiality, malicious_client_security, malicious_server_integrity, preprocessing_assumption, reveals_intermediate_activations_to_client, output_disclosure for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.formal_security.SecurityClaim - Kind:
class - Signature/type:
(name: 'str', input_confidentiality: 'bool', output_confidentiality: 'bool', model_confidentiality: "Literal['none', 'honest client', 'query limited', 'malicious client']", malicious_client_security: 'bool', malicious_server_integrity: 'bool', preprocessing_assumption: 'str', reveals_intermediate_activations_to_client: 'bool', output_disclosure: 'str') -> None - Public exports:
pllm.SecurityClaim - Public members:
to_dict(self) -> 'dict[str, object]'
GuardPolicy
Extraction-hardening controls for the fast proprietary protocol.
- Canonical object:
pllm.runtime.guarded_engine.GuardPolicy - Kind:
class - Signature/type:
(max_rows_per_request: 'int' = 4096, max_rows_per_owner_stage: 'int' = 16384, max_requests_per_owner_minute: 'int' = 4096, output_dither_bound: 'int' = 0) -> None - Public exports:
pllm.GuardPolicy
GuardedBlindedTransformerEngine
Fast proprietary inference with explicit extraction hardening.
- Canonical object:
pllm.runtime.guarded_engine.GuardedBlindedTransformerEngine - Kind:
class - Signature/type:
(*args: 'Any', guard_policy: 'GuardPolicy \| None' = None, **kwargs: 'Any') -> 'None' - Public exports:
pllm.GuardedBlindedTransformerEngine - Public members:
client_bundle(self, model_id: 'str') -> 'bytes';execute_stage(self, model_id: 'str', stage: 'StageSpec', payloads: 'list[bytes]') -> 'list[bytes]';guard_stats(self) -> 'dict[str, int]';load(self, manifest: 'ModelManifest') -> 'None'
HEAuthenticatedPreprocessor
Create authenticated arithmetic material with BFV.
- Canonical object:
pllm.runtime.he_authenticated_preprocessing.HEAuthenticatedPreprocessor - Kind:
class - Signature/type:
(*, modulus: 'int' = 65537, poly_modulus_degree: 'int' = 4096, alpha: 'int \| None' = None, seed: 'int \| None' = None, threads: 'int' = 1, tenseal_path: 'str \| Path \| None' = None, enable_linear_correlations: 'bool' = True) -> 'None' - Public exports:
pllm.HEAuthenticatedPreprocessor - Public members:
bit_mask(self, shape: 'Sequence[int]', bit_width: 'int \| None' = None) -> 'BitDecompositionMask';input_mask(self, shape: 'Sequence[int]') -> 'InputMask';linear_correlation(self, weight: 'np.ndarray', input_shape: 'Sequence[int]') -> 'LinearCorrelation';multiplication_triple(self, shape: 'Sequence[int]') -> 'MultiplicationTriple';random(self, shape: 'Sequence[int]') -> 'np.ndarray';share(self, clear: 'np.ndarray \| Sequence[int] \| int') -> 'AuthenticatedValue';summary(self) -> 'dict[str, int \| float]'
check_linear_result
Checks one linear output against supplied integrity material.
- Canonical object:
pllm.runtime.linear_integrity.check_linear_result - Kind:
function - Signature/type:
(input_value: 'np.ndarray', output_value: 'np.ndarray', key: 'LinearCheckKey', *, raise_on_failure: 'bool' = True) -> 'LinearCheckResult' - Public exports:
pllm.check_linear_result,pllm.verification.check_linear_result
create_linear_check_key
Create a client secret check key for a server matrix.
- Canonical object:
pllm.runtime.linear_integrity.create_linear_check_key - Kind:
function - Signature/type:
(weight: 'np.ndarray', *, modulus: 'int', checks: 'int' = 2, seed: 'int \| None' = None, model_fingerprint: 'str' = '', stage_id: 'str' = '') -> 'LinearCheckKey' - Public exports:
pllm.create_linear_check_key,pllm.verification.create_linear_check_key
ModelLoadError
Raised when a ModelLoad condition prevents the requested operation from completing.
- Canonical object:
pllm.runtime.loaders.ModelLoadError - Kind:
class - Signature/type:
signature not exposed - Public exports:
pllm.ModelLoadError,pllm.models.ModelLoadError
ModelManifest
Immutable ModelManifest record carrying id, architecture, source_format, source, vocab_size, hidden_size, intermediate_size, num_hidden_layers, num_attention_heads, num_key_value_heads, head_dim, context_length, tokenizer_path, chat_template, quantization, tied_embeddings, stages, metadata, created_at for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.models.ModelManifest - Kind:
class - Signature/type:
(id: 'str', architecture: 'str', source_format: 'str', source: 'str', vocab_size: 'int', hidden_size: 'int', intermediate_size: 'int', num_hidden_layers: 'int', num_attention_heads: 'int', num_key_value_heads: 'int', head_dim: 'int', context_length: 'int', tokenizer_path: 'str \| None' = None, chat_template: 'str \| None' = None, quantization: 'dict[str, Any] \| None' = None, tied_embeddings: 'bool' = False, stages: 'list[StageSpec]' = <factory>, metadata: 'dict[str, Any]' = <factory>, created_at: 'float' = <factory>) -> None - Public exports:
pllm.ModelManifest,pllm.models.ModelManifest - Public members:
classmethod from_dict(cls, value: 'dict[str, Any]') -> "'ModelManifest'";classmethod load(cls, path: 'str \| Path') -> "'ModelManifest'";property checkpoint_digest: 'str \| None';property fingerprint: 'str';property source_lock_digest: 'str \| None';save(self, path: 'str \| Path') -> 'None';to_dict(self, *, include_fingerprint: 'bool' = True) -> 'dict[str, Any]'
create_async_openai_client
Performs the create async openai client operation for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.official.create_async_openai_client - Kind:
function - Signature/type:
(*, gateway_url: 'str \| None' = None, gateway_api_key: 'str \| None' = None, preparation_url: 'str \| None' = None, preparation_api_key: 'str \| None' = None, api_key: 'str' = 'pllm-local-transport', base_url: 'str' = 'https://pllm.local/v1', session_transport: 'str \| None' = None, correlation_mode: 'str \| None' = None, correlation_prefetch: 'int \| None' = None, prepared_inventory_rows: 'int \| None' = None, token_cache_size: 'int \| None' = None, bundle_cache_mode: 'str \| None' = None, bundle_cache_dir: 'str \| None' = None, tenseal_path: 'str \| None' = None, **client_kwargs: 'Any') - Public exports:
pllm.create_async_openai_client,pllm.official.create_async_openai_client
create_openai_client
Create the installed official openai.OpenAI client over PLLM runtime.
- Canonical object:
pllm.runtime.official.create_openai_client - Kind:
function - Signature/type:
(*, gateway_url: 'str \| None' = None, gateway_api_key: 'str \| None' = None, preparation_url: 'str \| None' = None, preparation_api_key: 'str \| None' = None, api_key: 'str' = 'pllm-local-transport', base_url: 'str' = 'https://pllm.local/v1', session_transport: 'str \| None' = None, correlation_mode: 'str \| None' = None, correlation_prefetch: 'int \| None' = None, prepared_inventory_rows: 'int \| None' = None, token_cache_size: 'int \| None' = None, bundle_cache_mode: 'str \| None' = None, bundle_cache_dir: 'str \| None' = None, tenseal_path: 'str \| None' = None, **client_kwargs: 'Any') - Public exports:
pllm.create_openai_client,pllm.official.create_openai_client
create_preparation_app
Builds the preparation ASGI application from validated runtime dependencies.
- Canonical object:
pllm.runtime.preparation_server.create_preparation_app - Kind:
function - Signature/type:
(config: 'GatewayConfig', engine: 'MaskedTransformerEngine', *, audit_hook: 'Callable[[str, bytes], None] \| None' = None, push_client: 'httpx.AsyncClient \| None' = None) -> 'FastAPI' - Public exports:
pllm.create_preparation_app,pllm.preparation.create_preparation_app
PreparedInventory
Single use material generated for one recorded execution plan.
- Canonical object:
pllm.runtime.preprocessing_inventory.PreparedInventory - Kind:
class - Signature/type:
(generator, entries: 'list[PreparedEntry]') -> 'None' - Public exports:
pllm.PreparedInventory - Public members:
bit_mask(self, shape: 'Sequence[int]', bit_width: 'int \| None' = None) -> 'BitDecompositionMask';classmethod generate(cls, plan: 'PreprocessingPlan', generator) -> "'PreparedInventory'";input_mask(self, shape: 'Sequence[int]') -> 'InputMask';linear_correlation(self, weight: 'np.ndarray', input_shape: 'Sequence[int]') -> 'LinearCorrelation';multiplication_triple(self, shape: 'Sequence[int]') -> 'MultiplicationTriple';property consumed: 'int';property remaining: 'int'
PreprocessingPlan
Immutable PreprocessingPlan record carrying entries for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.preprocessing_inventory.PreprocessingPlan - Kind:
class - Signature/type:
(entries: 'list[PlanEntry]' = <factory>) -> None - Public exports:
pllm.PreprocessingPlan - Public members:
counts(self) -> 'dict[str, int]';property operation_count: 'int'
RecordingPreprocessor
Record the material requested by a secure arithmetic program.
- Canonical object:
pllm.runtime.preprocessing_inventory.RecordingPreprocessor - Kind:
class - Signature/type:
(delegate) -> 'None' - Public exports:
pllm.RecordingPreprocessor - Public members:
bit_mask(self, shape: 'Sequence[int]', bit_width: 'int \| None' = None) -> 'BitDecompositionMask';input_mask(self, shape: 'Sequence[int]') -> 'InputMask';linear_correlation(self, weight: 'np.ndarray', input_shape: 'Sequence[int]') -> 'LinearCorrelation';multiplication_triple(self, shape: 'Sequence[int]') -> 'MultiplicationTriple'
PrivacyMode
Defines the accepted values for PrivacyMode: public, proprietary.
- Canonical object:
pllm.runtime.privacy.PrivacyMode - Kind:
class - Signature/type:
(*values) - Public exports:
pllm.PrivacyMode,pllm.runtime.PrivacyMode - Public members:
classmethod parse(cls, value: "str \| 'PrivacyMode'") -> "'PrivacyMode'";property description: 'str';property protocol: 'str'
ProprietaryProtocol
Defines the accepted values for ProprietaryProtocol: guarded, blinded, secure, direct.
- Canonical object:
pllm.runtime.privacy.ProprietaryProtocol - Kind:
class - Signature/type:
(*values) - Public exports:
pllm.ProprietaryProtocol,pllm.runtime.ProprietaryProtocol - Public members:
classmethod parse(cls, value: "str \| 'ProprietaryProtocol'") -> "'ProprietaryProtocol'"
DirectFHETransformerEngine
Direct BFV hybrid runtime for proprietary-weight checkpoints.
- Canonical object:
pllm.runtime.proprietary_engine.DirectFHETransformerEngine - Kind:
class - Signature/type:
(*, weight_bits: 'int' = 4, activation_bits: 'int' = 4, modulus: 'int \| None' = None, threads: 'int \| None' = None, native_library: 'str \| Path \| None' = None, tenseal_path: 'str \| None' = None, local_correlation_seed: 'int' = 20260817, compiled_cache_dir: 'str \| Path \| None' = None, streaming_threshold_elements: 'int' = 50000000, quantization_chunk_rows: 'int' = 64, verification_component: 'str' = 'none', verification_target_failure_bits: 'int' = 0) -> 'None' - Public exports:
pllm.DirectFHETransformerEngine - Public members:
client_bundle(self, model_id: 'str', *, include_local_weights: 'bool' = False) -> 'bytes';create_local_correlations(self, *args: 'Any', **kwargs: 'Any');evaluate_bfv_correlations(self, *args: 'Any', **kwargs: 'Any');execute_stage(self, model_id: 'str', stage: 'StageSpec', payloads: 'list[bytes]') -> 'list[bytes]';load(self, manifest: 'ModelManifest') -> 'None'
secure_argmax
Reveal only the index of the largest value in each row.
- Canonical object:
pllm.runtime.secure_selection.secure_argmax - Kind:
function - Signature/type:
(mpc: 'AuthenticatedMPC', values: 'AuthenticatedValue', *, bit_mask: 'BitDecompositionMask') -> 'SecureSelectionResult' - Public exports:
pllm.secure_argmax
SecureDecoder
A small complete decoder used to measure the secure execution path.
- Canonical object:
pllm.runtime.secure_transformer.SecureDecoder - Kind:
class - Signature/type:
(config: 'SecureDecoderConfig', weights: 'SecureDecoderWeights', preprocessor: 'TrustedPreprocessor') -> 'None' - Public exports:
pllm.SecureDecoder - Public members:
clear_forward_one_hot(self, one_hot: 'np.ndarray', *, cache: 'ClearKVCache \| None' = None) -> 'tuple[np.ndarray, np.ndarray]';clear_forward_token(self, token_ids: 'np.ndarray \| Sequence[int]', *, cache: 'ClearKVCache \| None' = None) -> 'tuple[np.ndarray, np.ndarray]';forward_one_hot(self, one_hot: 'np.ndarray', *, cache: 'SecureKVCache \| None' = None, material: 'SecureTokenMaterial \| None' = None, tamper_cache: 'bool' = False, output_disclosure: 'str' = 'token') -> 'SecureTokenResult';forward_token(self, token_ids: 'np.ndarray \| Sequence[int]', *, cache: 'SecureKVCache \| None' = None, material: 'SecureTokenMaterial \| None' = None, tamper_cache: 'bool' = False, output_disclosure: 'str' = 'token') -> 'SecureTokenResult';prepare_token(self, batch_size: 'int', *, output_disclosure: 'str' = 'token') -> 'SecureTokenMaterial'
SecureDecoderConfig
Immutable SecureDecoderConfig record carrying vocabulary_size, hidden_size, head_count, head_size, intermediate_size, maximum_context, field_modulus, attention_offset for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.secure_transformer.SecureDecoderConfig - Kind:
class - Signature/type:
(vocabulary_size: 'int' = 8, hidden_size: 'int' = 8, head_count: 'int' = 2, head_size: 'int' = 4, intermediate_size: 'int' = 12, maximum_context: 'int' = 4, field_modulus: 'int' = 65537, attention_offset: 'int' = 4) -> None - Public exports:
pllm.SecureDecoderConfig
SecureDecoderWeights
Immutable SecureDecoderWeights record carrying embedding, qkv, attention_output, gate_up, down, vocabulary_head, input_scale, mlp_scale for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.secure_transformer.SecureDecoderWeights - Kind:
class - Signature/type:
(embedding: 'np.ndarray', qkv: 'np.ndarray', attention_output: 'np.ndarray', gate_up: 'np.ndarray', down: 'np.ndarray', vocabulary_head: 'np.ndarray', input_scale: 'np.ndarray', mlp_scale: 'np.ndarray') -> None - Public exports:
pllm.SecureDecoderWeights - Public members:
classmethod random(cls, config: 'SecureDecoderConfig', *, seed: 'int' = 1) -> "'SecureDecoderWeights'"
create_app
Builds the app ASGI application from validated runtime dependencies.
- Canonical object:
pllm.runtime.server.create_app - Kind:
function - Signature/type:
(config: 'GatewayConfig \| None' = None, *, backend_registry: 'BackendRegistry \| None' = None, private_models: 'dict[str, MaskedBigramModel] \| None' = None, engines: 'dict[str, InferenceEngine] \| None' = None, audit_hook: 'Callable[[str, bytes], None] \| None' = None) -> 'FastAPI' - Public exports:
pllm.create_app,pllm.runtime.create_app,pllm.server.create_app
serve_local
Performs the serve local operation for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.servers.serve_local - Kind:
function - Signature/type:
serve_local(model: Model \| Pipeline \| Experiment \| str, *, model_id: str \| None=None, engine_threads: int \| None=None, weight_bits: int=8, activation_bits: int=8, correlation_mode: str='bfv', tenseal_path: str \| None=None, hf_cache_dir: str \| None=None, reserved_ports: Iterable[int]=(), rendezvous_capacity: int=262144, rendezvous_max_bytes: int=2147483648, log_dir: str \| Path \| None=None, telemetry_endpoint: str \| None=None, telemetry_token: str \| None=None, credential_prefix: str='local', startup_timeout: float=300.0, progress: Callable[[str], None] \| None=None) -> LocalTopology - Public exports:
pllm.runtime.serve_local,pllm.serve_local
create_sidecar_app
Builds the sidecar ASGI application from validated runtime dependencies.
- Canonical object:
pllm.runtime.sidecar.create_sidecar_app - Kind:
function - Signature/type:
(*, remote_base_url: 'str', remote_api_key: 'str', local_api_key: 'str' = 'local', client: 'OpenAI \| RuntimeClient \| None' = None, **client_kwargs: 'Any') -> 'FastAPI' - Public exports:
pllm.create_sidecar_app,pllm.runtime.create_sidecar_app
ClientBundle
Immutable ClientBundle record carrying model_id, manifest, cfg, tokenizer_descriptor, stages, arrays, privacy, schema_version for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.transformer_client.ClientBundle - Kind:
class - Signature/type:
(model_id: 'str', manifest: 'dict[str, Any]', cfg: 'dict[str, Any]', tokenizer_descriptor: 'dict[str, Any]', stages: 'dict[str, StageMetadata]', arrays: 'dict[str, np.ndarray]', privacy: 'dict[str, Any]', schema_version: 'int' = 1) -> None - Public exports:
pllm.ClientBundle - Public members:
classmethod unpack(cls, payload: 'bytes') -> "'ClientBundle'";local_linear(self, stage_id: 'str', activation: 'np.ndarray') -> 'np.ndarray';local_token_lookup(self, token_ids: 'np.ndarray') -> 'np.ndarray';property config: 'dict[str, Any]';property local_tensors: 'dict[str, np.ndarray]';render_prompt(self, messages: 'list[Any]', *, add_generation_prompt: 'bool' = True, tools: 'list[dict[str, Any]] \| None' = None) -> 'str';tensor(self, suffix: 'str', *, default: 'np.ndarray \| None' = None) -> 'np.ndarray';tokenizer(self) -> 'Tokenizer'
MaskedTransformerClientRuntime
Client-owned nonlinear, attention, KV-cache and sampling runtime.
- Canonical object:
pllm.runtime.transformer_client.MaskedTransformerClientRuntime - Kind:
class - Signature/type:
(bundle: 'ClientBundle', remote: 'Callable[[str, np.ndarray], np.ndarray]', *, stage_routes: 'dict[str, str] \| None' = None, token_cache: 'OrderedDict[int, np.ndarray] \| None' = None, token_cache_size: 'int' = 512, token_cache_lock: 'threading.Lock \| None' = None) -> 'None' - Public exports:
pllm.MaskedTransformerClientRuntime - Public members:
decode_step(self, token_id: 'int', caches: 'list[LayerCache] \| None', position: 'int \| None' = None) -> 'tuple[np.ndarray, list[LayerCache]]';encode_prompt(self, prompt: 'str') -> 'list[int]';forward_ids(self, ids: 'list[int] \| np.ndarray') -> 'np.ndarray';generate_steps(self, prompt: 'str', *, max_output_tokens: 'int', temperature: 'float' = 0.0, top_p: 'float \| None' = None);prepare(self, prompt: 'str') -> 'tuple[list[int], np.ndarray, list[LayerCache]]';prepare_ids(self, ids: 'list[int]') -> 'tuple[list[int], np.ndarray, list[LayerCache]]';reset(self) -> 'None';restore(self, snapshot: 'RuntimeSnapshot') -> 'None';sample(self, logits: 'np.ndarray', *, temperature: 'float' = 0.0, top_p: 'float \| None' = None) -> 'int';snapshot(self) -> 'RuntimeSnapshot'
MaskedTransformerEngine
Safetensors-backed W4A4 Transformer engine with HE-generated masks.
- Canonical object:
pllm.runtime.transformer_engine.MaskedTransformerEngine - Kind:
class - Signature/type:
(*, weight_bits: 'int' = 4, activation_bits: 'int' = 4, modulus: 'int \| None' = None, threads: 'int \| None' = None, native_library: 'str \| Path \| None' = None, tenseal_path: 'str \| None' = None, local_correlation_seed: 'int' = 20260817, compiled_cache_dir: 'str \| Path \| None' = None, streaming_threshold_elements: 'int' = 50000000, quantization_chunk_rows: 'int' = 64, verification_component: 'str' = 'none', verification_target_failure_bits: 'int' = 0) -> 'None' - Public exports:
pllm.MaskedTransformerEngine - Public members:
client_bundle(self, model_id: 'str', *, include_local_weights: 'bool' = True) -> 'bytes';client_bundle_bytes(self, model_id: 'str') -> 'bytes';create_local_correlations(self, model_id: 'str', stage_id: 'str', count: 'int', *, ring: 'str \| None' = None, rows: 'int \| None' = None, seed: 'int \| None' = None) -> 'list[StageCorrelation]';evaluate_bfv_correlation(self, model_id: 'str', stage_id: 'str', context_id: 'str', encrypted_mask: 'bytes') -> 'bytes';evaluate_bfv_correlations(self, model_id: 'str', stage_id: 'str', context_id: 'str', encrypted_masks: 'list[bytes]', *, cancel_event: 'threading.Event \| None' = None) -> 'list[bytes]';execute_stage(self, model_id: 'str', stage: 'StageSpec', payloads: 'list[bytes]') -> 'list[bytes]';load(self, manifest: 'ModelManifest') -> 'None';metrics(self) -> 'dict[str, Any]';model_manifest(self, model_id: 'str') -> 'ModelManifest';prepare_freivalds(self, authorization, request, policy);prepare_seeded_stage(self, request: 'PreparationRequest') -> 'CorrectionPush';register_bfv_context(self, model_id: 'str', context_id: 'str', public_context: 'bytes') -> 'None';seeded_profile(self, model_id: 'str', stage_id: 'str') -> 'SeededRingProfile';seeded_session_authorization(self, model_id: 'str', session_id: 'str', max_attempts: 'int') -> 'SessionAuthorization';seeded_stage_ids(self, model_id: 'str') -> 'tuple[str, ...]';stage_metadata(self, model_id: 'str', stage_id: 'str') -> 'StageMetadata';stats(self) -> 'dict[str, Any]';unload(self, model_id: 'str') -> 'None';validate_seeded_activation(self, request: 'MaskedStageRequest') -> 'None';validate_seeded_correction(self, correction: 'CorrectionPush') -> 'None';validate_seeded_preparation(self, request: 'PreparationRequest') -> 'None';validate_seeded_session_authorization(self, authorization: 'SessionAuthorization') -> 'None'
AsyncPLLMTransport
AsyncPLLMTransport provides async pllm transport behavior for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths. Public operations include aclose, handle_async_request, preprocess.
- Canonical object:
pllm.runtime.transport.AsyncPLLMTransport - Kind:
class - Signature/type:
(**kwargs: 'Any') -> 'None' - Public exports:
pllm.AsyncPLLMTransport,pllm.runtime.AsyncPLLMTransport - Public members:
aclose(self) -> 'None';handle_async_request(self, request: 'Any') -> 'Any';preprocess(self, model: 'str', *, count: 'int \| None' = None, stages: 'list[str] \| None' = None) -> 'dict[str, Any]'
PLLMTransport
Custom transport for the official OpenAI Python client.
- Canonical object:
pllm.runtime.transport.PLLMTransport - Kind:
class - Signature/type:
(*, gateway_url: 'str', api_key: 'str' = 'pllm-local', preparation_url: 'str \| None' = None, preparation_api_key: 'str \| None' = None, session_transport: 'str' = 'http', correlation_mode: 'str' = 'bfv', correlation_prefetch: 'int' = 4, prepared_inventory_rows: 'int' = 64, token_cache_size: 'int' = 512, bundle_cache_mode: 'str' = 'read-write', bundle_cache_dir: 'str \| None' = None, tenseal_path: 'str \| None' = None) -> 'None' - Public exports:
pllm.PLLMTransport,pllm.runtime.PLLMTransport - Public members:
close(self) -> 'None';handle_request(self, request: 'Any') -> 'Any';preprocess(self, model: 'str', *, count: 'int \| None' = None) -> 'dict[str, Any]'
Response
Immutable Response record carrying id, model, output, created_at, object, status, error, incomplete_details, instructions, metadata, parallel_tool_calls, frequency_penalty, presence_penalty, top_logprobs, max_tool_calls, reasoning, prompt, safety_identifier, prompt_cache_key, temperature, top_p, tools, tool_choice, truncation, max_output_tokens, previous_response_id, background, completed_at, service_tier, store, text, usage for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.types.Response - Kind:
class - Signature/type:
(id: 'str', model: 'str', output: 'list[dict[str, Any]]', created_at: 'int' = <factory>, object: "Literal['response']" = 'response', status: 'str' = 'completed', error: 'dict[str, Any] \| None' = None, incomplete_details: 'dict[str, Any] \| None' = None, instructions: 'Any' = None, metadata: 'dict[str, str] \| None' = None, parallel_tool_calls: 'bool' = True, frequency_penalty: 'float' = 0.0, presence_penalty: 'float' = 0.0, top_logprobs: 'int' = 0, max_tool_calls: 'int \| None' = None, reasoning: 'dict[str, Any] \| None' = None, prompt: 'dict[str, Any] \| None' = None, safety_identifier: 'str \| None' = None, prompt_cache_key: 'str \| None' = None, temperature: 'float \| None' = None, top_p: 'float \| None' = None, tools: 'list[dict[str, Any]]' = <factory>, tool_choice: 'str \| dict[str, Any]' = 'auto', truncation: 'str' = 'disabled', max_output_tokens: 'int \| None' = None, previous_response_id: 'str \| None' = None, background: 'bool' = False, completed_at: 'int \| None' = None, service_tier: 'str' = 'default', store: 'bool' = True, text: 'dict[str, Any]' = <factory>, usage: 'ResponseUsage \| None' = None) -> None - Public exports:
pllm.Response - Public members:
classmethod from_dict(cls, value: 'dict[str, Any]') -> "'Response'";classmethod text_response(cls, *, model: 'str', text: 'str', input_tokens: 'int', output_tokens: 'int', response_id: 'str \| None' = None, instructions: 'Any' = None, metadata: 'dict[str, str] \| None' = None, temperature: 'float \| None' = None, top_p: 'float \| None' = None) -> "'Response'";model_dump(self, **_: 'Any') -> 'dict[str, Any]';model_dump_json(self, **_: 'Any') -> 'str';property output_text: 'str';to_dict(self) -> 'dict[str, Any]'
ResponseEvent
Immutable ResponseEvent record carrying type, sequence_number, data for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.runtime.types.ResponseEvent - Kind:
class - Signature/type:
(type: 'str', sequence_number: 'int', data: 'dict[str, Any]') -> None - Public exports:
pllm.ResponseEvent - Public members:
classmethod from_dict(cls, value: 'dict[str, Any]') -> "'ResponseEvent'";model_dump(self, **_: 'Any') -> 'dict[str, Any]';to_dict(self) -> 'dict[str, Any]'
Constraint
Immutable Constraint record carrying path, operator, value for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.search.Constraint - Kind:
class - Signature/type:
__init__(self, path: str, operator: str, value: Any) -> None - Public exports:
pllm.Constraint,pllm.search.Constraint - Public members:
path: str;operator: str;value: Any;__init__(self, path: str, operator: str, value: Any) -> None;accepts(self, experiment: Experiment) -> bool
GridSearch
Immutable GridSearch record carrying identity, space for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.search.GridSearch - Kind:
class - Signature/type:
__init__(self, identity: str, space: SearchSpace) -> None - Public exports:
pllm.GridSearch,pllm.search.GridSearch - Public members:
identity: str;space: SearchSpace;__init__(self, identity: str, space: SearchSpace) -> None;candidates(self) -> tuple[SearchCandidate, ...];evaluate(self, evaluator: Callable[[SearchCandidate], BenchmarkResult]) -> tuple[SearchEvaluation, ...]
ParetoFrontier
Immutable ParetoFrontier record carrying objectives for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.search.ParetoFrontier - Kind:
class - Signature/type:
__init__(self, evaluations: Iterable[SearchEvaluation], *, objectives: Mapping[str, str]) -> None - Public exports:
pllm.ParetoFrontier,pllm.search.ParetoFrontier - Public members:
objectives: Mapping[str, str];__init__(self, evaluations: Iterable[SearchEvaluation], *, objectives: Mapping[str, str]) -> None;results(self) -> tuple[SearchEvaluation, ...];excluded(self) -> tuple[SearchEvaluation, ...]
RandomSearch
Immutable RandomSearch record carrying identity, space, count, seed for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.search.RandomSearch - Kind:
class - Signature/type:
__init__(self, identity: str, space: SearchSpace, *, count: int, seed: int) -> None - Public exports:
pllm.RandomSearch,pllm.search.RandomSearch - Public members:
identity: str;space: SearchSpace;count: int;seed: int;__init__(self, identity: str, space: SearchSpace, *, count: int, seed: int) -> None;candidates(self) -> tuple[SearchCandidate, ...];evaluate(self, evaluator: Callable[[SearchCandidate], BenchmarkResult]) -> tuple[SearchEvaluation, ...]
SearchCandidate
Immutable SearchCandidate record carrying trial_id, index, experiment, parameters, configuration_digest for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.search.SearchCandidate - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.SearchCandidate,pllm.search.SearchCandidate - Public members:
trial_id: str;index: int;experiment: Experiment;parameters: Mapping[str, Any];configuration_digest: str
SearchError
Raised when a Search condition prevents the requested operation from completing.
- Canonical object:
pllm.search.SearchError - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.SearchError,pllm.search.SearchError
SearchEvaluation
Immutable SearchEvaluation record carrying candidate, result for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.search.SearchEvaluation - Kind:
class - Signature/type:
constructor not exposed - Public exports:
pllm.SearchEvaluation,pllm.search.SearchEvaluation - Public members:
candidate: SearchCandidate;result: BenchmarkResult
SearchSpace
Immutable SearchSpace record carrying base, parameters, constraints for the workflow where the root package is the task-oriented sdk surface for describing a model, bounding a workload, selecting a pipeline, lowering semantic plans, and constructing clients without depending on internal module paths.
- Canonical object:
pllm.search.SearchSpace - Kind:
class - Signature/type:
__init__(self, base: Experiment, parameters: Mapping[str, Sequence[Any]], *, constraints: Iterable[Constraint]=...) -> None - Public exports:
pllm.SearchSpace,pllm.search.SearchSpace - Public members:
base: Experiment;parameters: Mapping[str, tuple[Any, ...]];constraints: tuple[Constraint, ...];__init__(self, base: Experiment, parameters: Mapping[str, Sequence[Any]], *, constraints: Iterable[Constraint]=...) -> None
evaluate_search
Evaluates candidate benchmark evidence using explicit cohort-safe metric directions.
- Canonical object:
pllm.search.evaluate_search - Kind:
function - Signature/type:
evaluate_search(candidates: Iterable[SearchCandidate], evaluator: Callable[[SearchCandidate], BenchmarkResult]) -> tuple[SearchEvaluation, ...] - Public exports:
pllm.evaluate_search,pllm.search.evaluate_search
BundleModel
Model(source: 'str', *, kind: 'str' = 'huggingface', model_id: 'str | None' = None, revision: 'str | None' = None, local_files_only: 'bool' = False, endpoint: 'str | None' = None) -> 'None'.
- Canonical object:
pllm.sources.BundleModel - Kind:
class - Signature/type:
__init__(self, path: str, *, format: str='huggingface', model_id: str \| None=None) -> None - Public exports:
pllm.BundleModel,pllm.sources.BundleModel - Public members:
__init__(self, path: str, *, format: str='huggingface', model_id: str \| None=None) -> None
TinyModel
Model(source: 'str', *, kind: 'str' = 'huggingface', model_id: 'str | None' = None, revision: 'str | None' = None, local_files_only: 'bool' = False, endpoint: 'str | None' = None) -> 'None'.
- Canonical object:
pllm.sources.TinyModel - Kind:
class - Signature/type:
__init__(self, family: str='qwen2', *, model_id: str \| None=None) -> None - Public exports:
pllm.TinyModel,pllm.sources.TinyModel - Public members:
__init__(self, family: str='qwen2', *, model_id: str \| None=None) -> None