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
|
Download README.md from Alienstro/xslm: direct link, hf CLI and curl.
- Browser
- Download file 2.4 kB
-
https://huggingface.co/Alienstro/xslm/resolve/main/README.md
- Command line
-
hf download hf://Alienstro/xslm/README.md
-
curl -L -o README.md https://huggingface.co/Alienstro/xslm/resolve/main/README.md
2.4 kB
| license: apache-2.0 | |
| language: | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| datasets: | |
| - HuggingFaceFW/fineweb-edu | |
| tags: | |
| - llama | |
| - gguf | |
| # xslm-70m | |
| A 70,546,560 parameter Llama-style decoder, trained from scratch on one RTX 3090 in | |
| 180 minutes. The project exists to teach the full training pipeline: the | |
| tokenizer, the data pipeline, the modules, and the training configuration. | |
| ## Limitations | |
| This model does not hold world knowledge. A model of this size learns grammar, style, | |
| and document structure. It invents facts. This is the expected result at this scale, | |
| and it is not a defect to report. | |
| For a model that answers questions correctly, use retrieval-augmented generation over a | |
| document index, or a QLoRA fine-tune of an existing 1B to 8B base model. | |
| ## Architecture | |
| | Field | Value | | |
| |---|---| | |
| | Non-embedding parameters | 49,575,040 | | |
| | Total parameters | 70,546,560 | | |
| | `hidden_size` | 640 | | |
| | `num_hidden_layers` | 10 | | |
| | `num_attention_heads` | 10 | | |
| | `intermediate_size` | 1728 | | |
| | `vocab_size` | 32768 | | |
| | `max_position_embeddings` | 1024 | | |
| | Normalization | RMSNorm | | |
| | Position encoding | RoPE, theta 10000.0 | | |
| | Activation | SwiGLU | | |
| | Embeddings | Tied input and output | | |
| ## Training | |
| | Field | Value | | |
| |---|---| | |
| | Corpus | `HuggingFaceFW/fineweb-edu`, `sample-10BT`, ODC-By license | | |
| | Tokenizer | Byte-level BPE, 32768 tokens | | |
| | Optimizer | AdamW, betas 0.9 and 0.95 | | |
| | Peak learning rate | 0.001 | | |
| | Schedule | 200 warmup steps, then cosine decay to 0.0001 | | |
| | Tokens for each optimizer step | 262,144 | | |
| | Precision | BF16 mixed | | |
| | Hardware | One RTX 3090 | | |
| ## Files | |
| | File | Use | | |
| |---|---| | |
| | `model.safetensors` | The BF16 weights, for `transformers` | | |
| | `gguf/xslm-70m-BF16.gguf` | The unquantized GGUF file, in the training dtype | | |
| | `gguf/xslm-70m-F16.gguf` | The unquantized GGUF file, for the tools that read no BF16 | | |
| | `gguf/xslm-70m-Q8_0.gguf` | **The recommended quantized file** | | |
| | `gguf/xslm-70m-Q6_K.gguf` | Smaller, with a visible quality cost | | |
| | `gguf/xslm-70m-Q4_K_M.gguf` | A demonstration only | | |
| At 70M parameters there is no redundancy to absorb quantization error. Q4_K_M often | |
| produces broken text. Use Q8_0. | |
| ## Use | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained("Alienstro/xslm") | |
| model = AutoModelForCausalLM.from_pretrained("Alienstro/xslm") | |
| ``` | |