Text Generation
MLX
Safetensors
English
base-model
pretrained
small-language-model
apple-silicon
from-scratch
research
Instructions to use OpenSML/OpenSML-Base-175M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpenSML/OpenSML-Base-175M with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("OpenSML/OpenSML-Base-175M") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use OpenSML/OpenSML-Base-175M with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "OpenSML/OpenSML-Base-175M" --prompt "Once upon a time"
- Atomic Chat
File size: 3,753 Bytes
8f2ec8e ea6ddf7 8f2ec8e ea6ddf7 dda072e ea6ddf7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # Run OpenSML-Base-175M
The package contains BF16 `model.safetensors`, the frozen tokenizer, configuration,
raw text-completion runner and native architecture/kernel source. The verified
platform is Apple Silicon macOS with Python 3.11 and stock MLX 0.32.3.
```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install huggingface_hub
# Authenticate if access requires it: hf auth login
hf download OpenSML/OpenSML-Base-175M --local-dir ./OpenSML-Base-175M
cd OpenSML-Base-175M
python -m pip install -r requirements.txt
python inference.py --prompt "Plants need sunlight because" --max-tokens 64
```
For a file prefix and machine-readable output:
```bash
python inference.py --prompt-file prompt.txt --max-tokens 128 --json
```
Default decoding is greedy, temperature 0. Sampling is available via
`--temperature 0.7 --seed 42`; packaging checks use greedy decoding. Input is a
raw document prefix. No user/assistant header, chat template, JSON Schema or
extraction adapter is applied. The output is a continuation, not an instruction-
tuned assistant response.
The runner defaults to the adjacent `model.safetensors`, checks its weight hash,
verifies/extracts `native_bundle.zip` to a temporary directory and loads the exact
native model/tokenizer. Generation runs offline after download and dependency
installation. Prompt plus generation budget must fit 2,048 tokens; overlong
requests are rejected rather than truncated. Generation stops on document-end,
a reserved structural token, or the token limit.
Use this supplied native runner. `transformers.AutoModel` and `mlx_lm.load` are
not supported auto-loading paths for this custom architecture. CPU-only, CUDA,
quantization and framework conversions have not been validated. The root
`tokenizer.json` and `tokenizer_config.json` mirror the bundle's frozen files;
the native bundle also includes all tokenizer integrity companions.
Verify all package files on macOS:
```bash
shasum -a 256 -c SHA256SUMS
```
The source archive contains `pretraining/sml_v1/model.py`, tokenization/common
modules and the matching packed SwiGLU/CE kernels. Its full source inventory is
recorded in `SOURCE_FILES.json`. These can be extracted with
`python -m zipfile -e native_bundle.zip native_bundle` for inspection or use in a
custom fine-tuning implementation. This download is an inference package, not a
one-command reproduction of the distributed pretraining corpus/optimizer state.
Base completions can repeat, invent facts or continue with irrelevant document
text. The recorded document loss does not guarantee correct QA, instruction
following or extraction. See the model card and report for measured scope.
## JSONLite descendant
The [OpenSML-JSONLite-175M-Instruct](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M) descendant uses 100,096,883 additional structured-data continued-pretraining tokens followed by one joint full-weight SFT. The main checkpoint inherits 32,000 SFT presentations. On the observed original 1,444-request extraction panel it scores 89.54% complete correctness, 94.91% field accuracy, 93.75% extracted-value F1, 96.13% missing-field accuracy and 99.93% schema validity. Broader structural diagnostics remain weaker: 183/384 complete requests (47.66%). These are descendant results, not scores of this base. See the [JSONLite technical report](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M/blob/main/TECHNICAL_REPORT.md).
JSONLite's supplied runner targets short English text and flat string-based schemas. Broader JSON tasks, arbitrary domains, chat and multilingual reliability are not established. Check schema validity and source-grounded meaning separately. The original base weights, tokenizer and inference runtime are unchanged.
|