Instructions to use Alienstro/xslm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Alienstro/xslm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Alienstro/xslm")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Alienstro/xslm") model = AutoModelForCausalLM.from_pretrained("Alienstro/xslm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Alienstro/xslm with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Alienstro/xslm:Q4_K_M # Run inference directly in the terminal: llama cli -hf Alienstro/xslm:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Alienstro/xslm:Q4_K_M # Run inference directly in the terminal: llama cli -hf Alienstro/xslm:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Alienstro/xslm:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Alienstro/xslm:Q4_K_M
Use Docker
docker model run hf.co/Alienstro/xslm:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Alienstro/xslm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Alienstro/xslm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Alienstro/xslm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Alienstro/xslm:Q4_K_M
- SGLang
How to use Alienstro/xslm 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 "Alienstro/xslm" \ --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": "Alienstro/xslm", "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 "Alienstro/xslm" \ --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": "Alienstro/xslm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use Alienstro/xslm with Ollama:
ollama run hf.co/Alienstro/xslm:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Alienstro/xslm with Docker Model Runner:
docker model run hf.co/Alienstro/xslm:Q4_K_M
- Lemonade
How to use Alienstro/xslm with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Alienstro/xslm:Q4_K_M
Run and chat with the model
lemonade run user.xslm-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload folder using huggingface_hub
Browse files- README.md +77 -0
- config.json +32 -0
- generation_config.json +9 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +7 -0
README.md
CHANGED
|
@@ -1,3 +1,80 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
datasets:
|
| 8 |
+
- HuggingFaceFW/fineweb-edu
|
| 9 |
+
tags:
|
| 10 |
+
- llama
|
| 11 |
+
- gguf
|
| 12 |
---
|
| 13 |
+
|
| 14 |
+
# xslm-70m
|
| 15 |
+
|
| 16 |
+
A 70,546,560 parameter Llama-style decoder, trained from scratch on one RTX 3090 in
|
| 17 |
+
180 minutes. The project exists to teach the full training pipeline: the
|
| 18 |
+
tokenizer, the data pipeline, the modules, and the training configuration.
|
| 19 |
+
|
| 20 |
+
## Limitations
|
| 21 |
+
|
| 22 |
+
This model does not hold world knowledge. A model of this size learns grammar, style,
|
| 23 |
+
and document structure. It invents facts. This is the expected result at this scale,
|
| 24 |
+
and it is not a defect to report.
|
| 25 |
+
|
| 26 |
+
For a model that answers questions correctly, use retrieval-augmented generation over a
|
| 27 |
+
document index, or a QLoRA fine-tune of an existing 1B to 8B base model.
|
| 28 |
+
|
| 29 |
+
## Architecture
|
| 30 |
+
|
| 31 |
+
| Field | Value |
|
| 32 |
+
|---|---|
|
| 33 |
+
| Non-embedding parameters | 49,575,040 |
|
| 34 |
+
| Total parameters | 70,546,560 |
|
| 35 |
+
| `hidden_size` | 640 |
|
| 36 |
+
| `num_hidden_layers` | 10 |
|
| 37 |
+
| `num_attention_heads` | 10 |
|
| 38 |
+
| `intermediate_size` | 1728 |
|
| 39 |
+
| `vocab_size` | 32768 |
|
| 40 |
+
| `max_position_embeddings` | 1024 |
|
| 41 |
+
| Normalization | RMSNorm |
|
| 42 |
+
| Position encoding | RoPE, theta 10000.0 |
|
| 43 |
+
| Activation | SwiGLU |
|
| 44 |
+
| Embeddings | Tied input and output |
|
| 45 |
+
|
| 46 |
+
## Training
|
| 47 |
+
|
| 48 |
+
| Field | Value |
|
| 49 |
+
|---|---|
|
| 50 |
+
| Corpus | `HuggingFaceFW/fineweb-edu`, `sample-10BT`, ODC-By license |
|
| 51 |
+
| Tokenizer | Byte-level BPE, 32768 tokens |
|
| 52 |
+
| Optimizer | AdamW, betas 0.9 and 0.95 |
|
| 53 |
+
| Peak learning rate | 0.001 |
|
| 54 |
+
| Schedule | 200 warmup steps, then cosine decay to 0.0001 |
|
| 55 |
+
| Tokens for each optimizer step | 262,144 |
|
| 56 |
+
| Precision | BF16 mixed |
|
| 57 |
+
| Hardware | One RTX 3090 |
|
| 58 |
+
|
| 59 |
+
## Files
|
| 60 |
+
|
| 61 |
+
| File | Use |
|
| 62 |
+
|---|---|
|
| 63 |
+
| `model.safetensors` | The BF16 weights, for `transformers` |
|
| 64 |
+
| `gguf/xslm-70m-BF16.gguf` | The unquantized GGUF file, in the training dtype |
|
| 65 |
+
| `gguf/xslm-70m-F16.gguf` | The unquantized GGUF file, for the tools that read no BF16 |
|
| 66 |
+
| `gguf/xslm-70m-Q8_0.gguf` | **The recommended quantized file** |
|
| 67 |
+
| `gguf/xslm-70m-Q6_K.gguf` | Smaller, with a visible quality cost |
|
| 68 |
+
| `gguf/xslm-70m-Q4_K_M.gguf` | A demonstration only |
|
| 69 |
+
|
| 70 |
+
At 70M parameters there is no redundancy to absorb quantization error. Q4_K_M often
|
| 71 |
+
produces broken text. Use Q8_0.
|
| 72 |
+
|
| 73 |
+
## Use
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 77 |
+
|
| 78 |
+
tokenizer = AutoTokenizer.from_pretrained("Alienstro/xslm")
|
| 79 |
+
model = AutoModelForCausalLM.from_pretrained("Alienstro/xslm")
|
| 80 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"dtype": "float32",
|
| 9 |
+
"eos_token_id": 0,
|
| 10 |
+
"head_dim": 64,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 640,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 1728,
|
| 15 |
+
"max_position_embeddings": 1024,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
+
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 10,
|
| 19 |
+
"num_hidden_layers": 10,
|
| 20 |
+
"num_key_value_heads": 10,
|
| 21 |
+
"pad_token_id": null,
|
| 22 |
+
"pretraining_tp": 1,
|
| 23 |
+
"rms_norm_eps": 1e-05,
|
| 24 |
+
"rope_parameters": {
|
| 25 |
+
"rope_theta": 10000.0,
|
| 26 |
+
"rope_type": "default"
|
| 27 |
+
},
|
| 28 |
+
"tie_word_embeddings": true,
|
| 29 |
+
"transformers_version": "5.17.0",
|
| 30 |
+
"use_cache": false,
|
| 31 |
+
"vocab_size": 32768
|
| 32 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 0,
|
| 5 |
+
"output_attentions": false,
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"transformers_version": "5.17.0",
|
| 8 |
+
"use_cache": false
|
| 9 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f79aa08999427e441f3b2d8e843477216593b11f55b60594ced5206bd4ae4a54
|
| 3 |
+
size 282196440
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"is_local": true,
|
| 4 |
+
"local_files_only": false,
|
| 5 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 6 |
+
"tokenizer_class": "TokenizersBackend"
|
| 7 |
+
}
|