Metadata-Version: 2.4
Name: po-lang-engine
Version: 3.1.0
Summary: Po-Lang Engine — A high-performance, GPU-free programming language with native AI (BigLLM, FractalImage, BitEngine)
Home-page: https://github.com/po-lang/po-lang-engine
Author: Po-Lang
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Interpreters
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary


# Po-Lang Engine v3.1.0 — Dynamic Custom Persistence & Fine-Tune

Po-Lang is a high-performance, Python-inspired programming language with native AI capabilities.

## New in v3.1.0

### `llm["fine_tune"](new_data, epochs?)` — Incremental 1-bit XOR Adjustment
Load a base model, fine-tune it with new data, save under a new name — original untouched.

```po
use ai

keep llm = ai.BigLLM()
llm["load"]("global_base_model.po_pack")   # load existing brain
llm["set_context"](4096)
llm["fine_tune"](["New company data 2026", "Customer support updates"], 5)
llm["save"]("customer_bot_v2.po_pack")     # save as new file, original kept
```

Output:
```
[ai.BigLLM] ── Fine-Tune (Incremental 1-bit XOR Adjustment) ──
[ai.BigLLM]  Base vocab  : 847 tokens  (kept intact)
[ai.BigLLM]  New tokens  : +12 words  (8 total new tok)
[ai.BigLLM]  Ctx window  : 4096  |  windows=1  epochs=5
[ai.BigLLM]  Params      : 1,000,000,000  GPU: 0  Float: 0
[ai.BigLLM]   ep 5/5  [100%]  windows=1/1  vocab=859
[ai.BigLLM] Fine-tune complete — vocab 847 → 859 (+12 new tokens)  RAM: freed
```

### Fine-Tune Architecture
- **Base vocab kept intact** — existing knowledge never erased
- **Only ADD** — new tokens appended, old patterns preserved
- **1-bit XOR co-occurrence** — zero float math, zero GPU
- **Context window respected** — chunked via `set_context` size
- **Any filename** — save to any `.po_pack`, `.weights`, or custom name

## Full API (v3.1.0)

```po
use ai

keep llm = ai.BigLLM()
llm["set_context"](2048)                                  # set context window
llm["train"](["Training corpus..."], 3)                   # full training
llm["fine_tune"](["New domain data..."], 5)               # incremental update
keep reply = llm["generate"]("Po-Lang is", 64)            # generate text
fn on_token(word, idx, done) { show word }
llm["stream"]("GPU-free", on_token, 32, 50)              # streaming output
llm["save"]("model_v2.po_pack")                           # save any filename
llm["load"]("base_model.weights")                         # load any filename
show llm["info"]()                                        # stats

keep img = ai.FractalImage()
img["generate"]("sunset over mountains", 80, 24)
img["ascii"]()
img["save"]("output.ppm")
```

## Features
- Native AI/ML: Regression, Classification, KNN, Tokenizer, BigLLM, FractalImage
- Context window: configurable 8–1,000,000 tokens
- Fine-tune: incremental 1-bit XOR adjustment, base model preserved
- 1-bit XNOR+Popcount BitEngine (30× faster than Python float ops)
- `.po_pack` binary save/load with CRC32 integrity check (any filename)
- HTTP server with optional BPP binary encoding and SSC security
- REPL, bytecode compiler, and `pop` CLI
- Zero heavy dependencies — only standard Python

## Install
```bash
pip install --upgrade po-lang-engine
pop run myfile.po
pop repl
```
