Text Generation
Transformers
strata
persistent-memory
structured-memory
neuro-symbolic
exact-value-copying
Instructions to use nur-dev/strata-native-lm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nur-dev/strata-native-lm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nur-dev/strata-native-lm")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nur-dev/strata-native-lm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nur-dev/strata-native-lm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nur-dev/strata-native-lm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nur-dev/strata-native-lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nur-dev/strata-native-lm
- SGLang
How to use nur-dev/strata-native-lm with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nur-dev/strata-native-lm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nur-dev/strata-native-lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nur-dev/strata-native-lm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nur-dev/strata-native-lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nur-dev/strata-native-lm with Docker Model Runner:
docker model run hf.co/nur-dev/strata-native-lm
|
Download README.md from nur-dev/strata-native-lm: direct link, hf CLI and curl.
- Browser
- Download file 6.62 kB
-
https://huggingface.co/nur-dev/strata-native-lm/resolve/main/README.md
- Command line
-
hf download hf://nur-dev/strata-native-lm/README.md
-
curl -L -o README.md https://huggingface.co/nur-dev/strata-native-lm/resolve/main/README.md
6.62 kB
| license: cc-by-nc-4.0 | |
| library_name: transformers | |
| base_model: Qwen/Qwen3-4B-Instruct-2507 | |
| pipeline_tag: text-generation | |
| tags: | |
| - strata | |
| - persistent-memory | |
| - structured-memory | |
| - neuro-symbolic | |
| - exact-value-copying | |
| # STRATA Native LM v1 | |
| Licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) for non-commercial use. Commercial use requires separate permission from the rights holders. The upstream base model and third-party dependencies retain their respective licenses. | |
| STRATA Native LM couples a frozen Qwen3-4B-Instruct-2507 backbone to a trained 20.44M-parameter memory interface. It generates short factual responses from trusted structured observations supplied by tools, APIs, or applications. Structured writes and read addresses are supplied explicitly. The runtime executes joins; the language model verbalizes their selected results. Open-ended response generation was not evaluated. | |
| ```text | |
| structured observation | |
| -> WRITE(instance, predicate, role, value) | |
| -> persistent structured memory | |
| -> memory-conditioned language model | |
| -> generated frame + exact value copying | |
| ``` | |
| The reader decodes and latches an address-bound value code. During response-frame generation the actual value state is replaced by a fixed neutral state, and COPY validates the selected record. Its bytes are inserted after frame completion. No previous source tokens, source-history KV-cache entries, persisted source residuals, or actual value tokens enter frame generation. Integrity checks reject invalid, stale, deleted, or corrupted references. | |
| The 255 nonzero value codes are reused across records, not global value identifiers. Structured-service adapters assign a field index; persistent identity comes from the full instance/predicate/role address and version. The evaluated copy bank contains one runtime-selected record per request. Arbitrary application bytes remain in that record and are not encoded by the 8-bit code. | |
| ## Results | |
| | Metric | Result | | |
| | --- | ---: | | |
| | Atomic writes in state history | 2,004,344 | | |
| | Transactions | 564,312 | | |
| | Unique base records | 4,096 | | |
| | Evaluations across ages and packings | 61,440 | | |
| | Persistent-memory horizon | 128 independent 8,192-token windows | | |
| | Factual accuracy | 1.000 | | |
| | Copied-value byte correctness | 1.000 | | |
| | Three schemas excluded from component training | 768 unique records; 11,520 evaluations; 1.000 | | |
| | Runtime-executed 2/3/4-hop joins | 1.000 | | |
| | Field-specific intervention following | 1.000 | | |
| | Integrity verification and execution replay | 1.000 | | |
| | Structured-service retained-state reduction, including values and integrity metadata | At least 86.72% | | |
| | Neural value-state reduction | 95.83% (128 vs. 3,072 bytes/value) | | |
| The neural-state figure excludes application value bytes and shared address/integrity metadata. The structured-service accounting includes those bytes. The horizon is persistence across independent windows, not a single Transformer context. | |
| STRATA and the realization-matched token-value arm both achieved 1.000 factual accuracy. The original uncached source-history timing remains in `evaluation.json` as an implementation diagnostic, not a speed claim against optimized cached serving. The three training-excluded schemas share the trained memory interface, operation inventory, and templated query format. | |
| ## Selected-Result Prompt Comparison | |
| The same 4,096 unique selected current records were passed to the frozen base model as JSON in the current prompt, with within-request KV caching enabled. Both interfaces were evaluated twice on eight L40 GPUs without cross-request prefix caching. | |
| | Metric | STRATA | Prompt serialization | | |
| | --- | ---: | ---: | | |
| | Stored UTF-8 value reproduced exactly once | 4,096/4,096 | 4,051/4,096 | | |
| | Ordinary bindings and resolved joins | 3,328/3,328 | 3,328/3,328 | | |
| | Mean input tokens/request | 64.52 | 136.29 | | |
| | Batch-amortized ms/record | 37.81 | 117.51 | | |
| | Generation-cap cases | 0 | 8 | | |
| All 45 prompt failures were in the hard-value holdout: 36 explicit refusals, eight outputs capped at 256 generated tokens, and one other value mismatch. Prompt generation freely spells values; STRATA copies their bytes. These are measured interface tradeoffs, not an optimized-serving or retrieval-quality ranking. Both passes produced identical responses. | |
| The `comparison/` directory contains the selected records, sealed responses, protocol, results, and executable comparison. Recompute published scores without a GPU: | |
| ```bash | |
| python3 comparison/benchmark.py --score-published | |
| ``` | |
| After installation and base-model download, reproduce both interfaces on eight GPUs: | |
| ```bash | |
| python3 comparison/benchmark.py --base-model "$STRATA_BASE_MODEL" --output comparison-run | |
| ``` | |
| ## Install | |
| Requires Python 3.11 or newer and a CUDA-capable PyTorch installation. A single NVIDIA L40 with 46 GB memory was used for the release inference check. | |
| ```bash | |
| python3 -m pip install huggingface_hub | |
| hf download nur-dev/strata-native-lm --local-dir strata-native-lm-v1 | |
| cd strata-native-lm-v1 | |
| python3 verify.py | |
| python3 -m pip install -r requirements.txt | |
| python3 -m pip install --no-deps wheels/strata-0.1.0.post2-py3-none-any.whl | |
| hf download Qwen/Qwen3-4B-Instruct-2507 \ | |
| --revision cdbee75f17c01a7cc42f958dc650907174af0554 \ | |
| --local-dir base-model | |
| export STRATA_BASE_MODEL="$PWD/base-model" | |
| ``` | |
| ## Run | |
| This example constructs one structured observation and reads it without putting its value in the query. | |
| ```bash | |
| python3 load_and_answer.py \ | |
| --event calendar:meeting_283 \ | |
| --predicate meeting \ | |
| --role location \ | |
| --payload-handle 17 \ | |
| --payload "North Campus Room 17" \ | |
| --query "Where is the meeting?" \ | |
| --device cuda:0 | |
| ``` | |
| The JSON response contains `answer`, `frame`, `status`, `payload_handle`, `receipt`, and timing fields. Successful output contains the stored value `North Campus Room 17` verbatim; surrounding wording is generated by the model. | |
| ## Files | |
| | Path | Contents | | |
| | --- | --- | | |
| | `checkpoints/` | Compact-memory reader, memory interface, and copy-action head | | |
| | `configs/` | Inference settings | | |
| | `evaluation.json` | Evaluation metrics, criteria, and source-artifact hashes | | |
| | `comparison/` | Selected-result baseline data, outputs, protocol, results, and runner | | |
| | `wheels/` | Runtime package | | |
| | `BASE_MODEL.json` | Required upstream model and immutable revision | | |
| | `load_and_answer.py` | Executable structured-read example | | |
| | `verify.py`, `MANIFEST.sha256` | Local file-integrity verification | | |
| The base model is downloaded from its upstream Hugging Face repository; its weights are not duplicated here. | |