# ProgramAsWeights (PAW) **Compile natural language specifications into neural programs that run locally.** ProgramAsWeights lets you define functions in English and compile them into tiny neural programs (.paw files) that run on your machine. Once compiled, they work as regular Python functions -- no internet connection, no external service, no per-call fees. ## Quick Start ```bash pip install programasweights --extra-index-url https://pypi.programasweights.com/simple/ ``` ```python import programasweights as paw # Load an official program by name fn = paw.function("email-triage") result = fn("Thesis defense committee needs your signature by EOD") print(result) # "immediate" result = fn("Department newsletter: spring picnic next Friday") print(result) # "wait" ``` ## Compile Your Own ```python import programasweights as paw # Describe what you want in English program = paw.compile( "Fix malformed JSON: repair missing quotes and trailing commas" ) # Use the compiled program fn = paw.function(program.id) fn("{name: 'Alice', age: 30,}") # '{"name":"Alice","age":30}' ``` ## What Can You Build? PAW is for functions that are easy to describe but hard to code as rules: - **Fuzzy search** -- typo-tolerant matching, semantic search, near-duplicate detection - **Format repair** -- fix broken JSON, normalize dates, repair malformed API inputs - **Log triage** -- extract errors from verbose output, detect anomalies - **Custom classification** -- define "important" or "urgent" in your own words - **Smart notifications** -- classify emails/messages by your own urgency rules - **Agent preprocessing** -- parse tool calls, route tasks, validate outputs ## How It Works Each compiled program has two parts: 1. **Discrete pseudo-program** -- text instructions generated by the neural compiler 2. **Continuous neural adapter** -- LoRA weights (~23 MB) that tune the interpreter model At runtime, the SDK loads a quantized base model (Q6_K ~594 MB for Qwen3, Q8_0 ~134 MB for GPT-2, downloaded once) and applies the LoRA adapter. Inference runs entirely locally via llama.cpp. ## Browser Inference Programs compiled with the compact interpreter (GPT-2 124M) also run directly in the browser via WebAssembly -- no custom server needed for inference: ```html ``` See the [Browser Inference guide](guide/browser-inference.md) for details. ## Next Steps - [Installation](getting-started/installation.md) -- detailed setup guide - [Your First Program](getting-started/first-program.md) -- step-by-step tutorial - [Writing Good Specs](guide/writing-good-specs.md) -- tips for effective specifications - [Python SDK Reference](api-reference/python-sdk.md) -- full API documentation - [Browser SDK](guide/browser-inference.md) -- run programs in the browser - [Browse the Hub](hub/browsing-programs.md) -- discover community programs