Text Generation
MLX
Safetensors
English
small-language-model
from-scratch
conversational
apple-silicon
research
Instructions to use OpenSML/Solstice-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpenSML/Solstice-1 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("OpenSML/Solstice-1") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use OpenSML/Solstice-1 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "OpenSML/Solstice-1"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "OpenSML/Solstice-1" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenSML/Solstice-1", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
File size: 1,763 Bytes
7bcd331 | 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 | #!/usr/bin/env python3
"""Verify release files without loading the model or accessing the network."""
import argparse
import hashlib
import json
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def digest(path):
with path.open('rb') as stream:
return hashlib.file_digest(stream, 'sha256').hexdigest()
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--source-only', action='store_true', help='Allow the GitHub checkout to omit model.safetensors.')
args = parser.parse_args()
files = json.loads((ROOT/'FILE_MANIFEST.json').read_text())['files']
failures = []
checked = 0
for name, record in files.items():
path = (ROOT/name).resolve()
if not path.is_relative_to(ROOT) or not path.is_file():
failures.append(f'Missing or invalid path: {name}')
elif path.stat().st_size != record['bytes'] or digest(path) != record['sha256']:
failures.append(f'Integrity mismatch: {name}')
else:
checked += 1
weights = ROOT/'model.safetensors'
if weights.is_file():
expected = json.loads((ROOT/'config.json').read_text())['weight_sha256']
if 'model.safetensors' not in files:
if digest(weights) != expected:
failures.append('Weight checksum does not match config.json')
else:
checked += 1
elif not args.source_only:
failures.append('Missing model.safetensors; download it from OpenSML/Solstice-1.')
print(json.dumps({'passed': not failures, 'files_verified': checked, 'weights_present': weights.is_file(), 'failures': failures}, indent=2))
raise SystemExit(bool(failures))
if __name__ == '__main__':
main()
|