Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

ProgramAsWeights

Compile natural language specs into tiny neural functions that run locally.

PyPI npm License

Website · Docs · Program Hub · Agents · Discussions


Quick Start

pip install programasweights --extra-index-url https://pypi.programasweights.com/simple/
import programasweights as paw

# Compile a natural language spec into a neural function
program = paw.compile(
    "Classify if this message requires immediate attention or can wait",
)

# Load and run locally — no internet needed after download
fn = paw.function(program.id)
fn("Server is down, customers affected!")  # → "immediate"
fn("Newsletter: spring picnic Friday")     # → "can wait"

Once compiled, functions run offline — no API keys, no internet, no per-call cost.

When to use PAW

  • Classification — sentiment, urgency, intent routing
  • Extraction — emails, names, dates from unstructured text
  • Format repair — fix broken JSON, normalize dates
  • Fuzzy search — typo-tolerant matching, near-duplicate detection
  • Agent preprocessing — parse tool calls, validate outputs, route tasks

Browser SDK

Programs compiled with the Compact interpreter also run in the browser via WebAssembly — no server needed, data stays on the user's device.

npm install @programasweights/web
import paw from '@programasweights/web';

const fn = await paw.function('programasweights/email-triage');
await fn('Server is down!');  // → "immediate"

Repositories

Repo Description
programasweights-python Python SDK
programasweights-js Browser SDK
wllama WebAssembly llama.cpp fork with LoRA + KV cache support

Two interpreters

Standard (Qwen3 0.6B) Compact (GPT-2 124M)
Accuracy Higher Lower
Program size ~22 MB ~5 MB
Runs in browser No Yes