# pllm.compiler Python API

Public objects, practical usage, and research context for pllm.compiler.

[View canonical HTML](https://pllm.run/sdk/reference/python/pllm/compiler/)

Document ID: `pllm.docs.reference.python.pllm.compiler`  
Release: `0.1.0`

The compiler accepts canonical request bytes, verifies complete capability coverage, and returns opaque native plans or fails closed. Presence documents API availability, not complete model, security, or deployment coverage; check [implementation status](/sdk/reference/status/) before relying on a path.

## Research context

Relevant design inputs: [HyCC](/research/papers/r09-hycc/). PLLM's implementation and evidence claims remain independent.

## 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.

```python
import pllm.compiler as compiler

rejected = False
try:
    compiler.compile(b"{}")
except compiler.CompilationError as error:
    rejected = "E_INVALID_DOCUMENT" in str(error)
assert rejected
```

API: [`pllm.compiler`](/sdk/reference/python/pllm/compiler/#objects-and-signatures)

## Objects and signatures

### `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`
