Text Generation
MLX
Safetensors
English
information-extraction
structured-output
json
small-language-model
apple-silicon
from-scratch
post-training
research
Instructions to use OpenSML/OpenSML-JSONLite-175M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpenSML/OpenSML-JSONLite-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-JSONLite-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-JSONLite-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-JSONLite-175M" --prompt "Once upon a time"
- Atomic Chat
Make example JSON schemas and outputs collapsible
Browse filesWrap the eight JSON code blocks in native expandable details sections, collapsed by default. Preserve every source, schema, generated output and metric. Update the README checksum.
- README.md +32 -8
- SHA256SUMS +1 -1
README.md
CHANGED
|
@@ -81,7 +81,8 @@ Source text:
|
|
| 81 |
Play the track Blue Lantern by Mira Sol.
|
| 82 |
```
|
| 83 |
|
| 84 |
-
|
|
|
|
| 85 |
|
| 86 |
```json
|
| 87 |
{
|
|
@@ -118,12 +119,17 @@ JSON Schema:
|
|
| 118 |
}
|
| 119 |
```
|
| 120 |
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
```json
|
| 124 |
{"track":["Blue Lantern"],"artist":["Mira Sol"],"album":[]}
|
| 125 |
```
|
| 126 |
|
|
|
|
|
|
|
| 127 |
Run: `python inference.py --example 29`.
|
| 128 |
|
| 129 |
### Restaurant request
|
|
@@ -134,7 +140,8 @@ Source text:
|
|
| 134 |
Book River Moon in Denver for four people tomorrow.
|
| 135 |
```
|
| 136 |
|
| 137 |
-
|
|
|
|
| 138 |
|
| 139 |
```json
|
| 140 |
{
|
|
@@ -179,12 +186,17 @@ JSON Schema:
|
|
| 179 |
}
|
| 180 |
```
|
| 181 |
|
| 182 |
-
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
```json
|
| 185 |
{"restaurant_name":["River Moon"],"city":["Denver"],"party_size_number":["four"],"timeRange":["tomorrow"]}
|
| 186 |
```
|
| 187 |
|
|
|
|
|
|
|
| 188 |
Run: `python inference.py --example 30`.
|
| 189 |
|
| 190 |
### Multiple artists
|
|
@@ -195,7 +207,8 @@ Source text:
|
|
| 195 |
Play songs by Mira Sol and Theo Lane.
|
| 196 |
```
|
| 197 |
|
| 198 |
-
|
|
|
|
| 199 |
|
| 200 |
```json
|
| 201 |
{
|
|
@@ -224,12 +237,17 @@ JSON Schema:
|
|
| 224 |
}
|
| 225 |
```
|
| 226 |
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
| 228 |
|
| 229 |
```json
|
| 230 |
{"artist":["Mira Sol","Theo Lane"],"album":[]}
|
| 231 |
```
|
| 232 |
|
|
|
|
|
|
|
| 233 |
Run: `python inference.py --example 35`.
|
| 234 |
|
| 235 |
### Nullable fields
|
|
@@ -240,7 +258,8 @@ Source text:
|
|
| 240 |
Play the last theme by Behzad Mirkhani.
|
| 241 |
```
|
| 242 |
|
| 243 |
-
|
|
|
|
| 244 |
|
| 245 |
```json
|
| 246 |
{
|
|
@@ -278,12 +297,17 @@ JSON Schema:
|
|
| 278 |
}
|
| 279 |
```
|
| 280 |
|
| 281 |
-
|
|
|
|
|
|
|
|
|
|
| 282 |
|
| 283 |
```json
|
| 284 |
{"playlist":null,"music_item":"theme","service":null}
|
| 285 |
```
|
| 286 |
|
|
|
|
|
|
|
| 287 |
Run: `python inference.py --example 48`.
|
| 288 |
|
| 289 |
## Training
|
|
|
|
| 81 |
Play the track Blue Lantern by Mira Sol.
|
| 82 |
```
|
| 83 |
|
| 84 |
+
<details>
|
| 85 |
+
<summary>View JSON Schema</summary>
|
| 86 |
|
| 87 |
```json
|
| 88 |
{
|
|
|
|
| 119 |
}
|
| 120 |
```
|
| 121 |
|
| 122 |
+
</details>
|
| 123 |
+
|
| 124 |
+
<details>
|
| 125 |
+
<summary>View generated JSON</summary>
|
| 126 |
|
| 127 |
```json
|
| 128 |
{"track":["Blue Lantern"],"artist":["Mira Sol"],"album":[]}
|
| 129 |
```
|
| 130 |
|
| 131 |
+
</details>
|
| 132 |
+
|
| 133 |
Run: `python inference.py --example 29`.
|
| 134 |
|
| 135 |
### Restaurant request
|
|
|
|
| 140 |
Book River Moon in Denver for four people tomorrow.
|
| 141 |
```
|
| 142 |
|
| 143 |
+
<details>
|
| 144 |
+
<summary>View JSON Schema</summary>
|
| 145 |
|
| 146 |
```json
|
| 147 |
{
|
|
|
|
| 186 |
}
|
| 187 |
```
|
| 188 |
|
| 189 |
+
</details>
|
| 190 |
+
|
| 191 |
+
<details>
|
| 192 |
+
<summary>View generated JSON</summary>
|
| 193 |
|
| 194 |
```json
|
| 195 |
{"restaurant_name":["River Moon"],"city":["Denver"],"party_size_number":["four"],"timeRange":["tomorrow"]}
|
| 196 |
```
|
| 197 |
|
| 198 |
+
</details>
|
| 199 |
+
|
| 200 |
Run: `python inference.py --example 30`.
|
| 201 |
|
| 202 |
### Multiple artists
|
|
|
|
| 207 |
Play songs by Mira Sol and Theo Lane.
|
| 208 |
```
|
| 209 |
|
| 210 |
+
<details>
|
| 211 |
+
<summary>View JSON Schema</summary>
|
| 212 |
|
| 213 |
```json
|
| 214 |
{
|
|
|
|
| 237 |
}
|
| 238 |
```
|
| 239 |
|
| 240 |
+
</details>
|
| 241 |
+
|
| 242 |
+
<details>
|
| 243 |
+
<summary>View generated JSON</summary>
|
| 244 |
|
| 245 |
```json
|
| 246 |
{"artist":["Mira Sol","Theo Lane"],"album":[]}
|
| 247 |
```
|
| 248 |
|
| 249 |
+
</details>
|
| 250 |
+
|
| 251 |
Run: `python inference.py --example 35`.
|
| 252 |
|
| 253 |
### Nullable fields
|
|
|
|
| 258 |
Play the last theme by Behzad Mirkhani.
|
| 259 |
```
|
| 260 |
|
| 261 |
+
<details>
|
| 262 |
+
<summary>View JSON Schema</summary>
|
| 263 |
|
| 264 |
```json
|
| 265 |
{
|
|
|
|
| 297 |
}
|
| 298 |
```
|
| 299 |
|
| 300 |
+
</details>
|
| 301 |
+
|
| 302 |
+
<details>
|
| 303 |
+
<summary>View generated JSON</summary>
|
| 304 |
|
| 305 |
```json
|
| 306 |
{"playlist":null,"music_item":"theme","service":null}
|
| 307 |
```
|
| 308 |
|
| 309 |
+
</details>
|
| 310 |
+
|
| 311 |
Run: `python inference.py --example 48`.
|
| 312 |
|
| 313 |
## Training
|
SHA256SUMS
CHANGED
|
@@ -3,7 +3,7 @@ dfe55d5efa7268fa3e8f2997dcb148e0145db80960cd460a242bacc81cef61a0 CITATION.cff
|
|
| 3 |
38eaa196a9bcbbb363d207b46a3c42fcc589687b7b9980e7eff218a1a8cf8bdb JSONLITE_RESULTS.json
|
| 4 |
c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE
|
| 5 |
30291e6ad10c7f9a79108f327fc26e68d52a3d579df36f2ac6d8dacc2316e9bf PACKAGING_VERIFICATION.json
|
| 6 |
-
|
| 7 |
824603c7bd790050ad56e65102c366ede53fcf461b62ac2c6474a2a75a0fc9a5 RUN_GUIDE.md
|
| 8 |
d5de06e61d0d6bd7245e515f41f7d3ca2d0716acc69d460f676b86f449fd078c SOURCE_NOTICE.md
|
| 9 |
974f3a2d6837c08d989a64ba942009c75a5d2015d32c6783c679ba6e8b47f907 TECHNICAL_REPORT.md
|
|
|
|
| 3 |
38eaa196a9bcbbb363d207b46a3c42fcc589687b7b9980e7eff218a1a8cf8bdb JSONLITE_RESULTS.json
|
| 4 |
c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE
|
| 5 |
30291e6ad10c7f9a79108f327fc26e68d52a3d579df36f2ac6d8dacc2316e9bf PACKAGING_VERIFICATION.json
|
| 6 |
+
639b899cda692dcf62c5b817e075a3b3da9847dd062235c4cde042ca6cbd903c README.md
|
| 7 |
824603c7bd790050ad56e65102c366ede53fcf461b62ac2c6474a2a75a0fc9a5 RUN_GUIDE.md
|
| 8 |
d5de06e61d0d6bd7245e515f41f7d3ca2d0716acc69d460f676b86f449fd078c SOURCE_NOTICE.md
|
| 9 |
974f3a2d6837c08d989a64ba942009c75a5d2015d32c6783c679ba6e8b47f907 TECHNICAL_REPORT.md
|