Instructions to use xxrickyxx/Ailo340m-v4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xxrickyxx/Ailo340m-v4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="xxrickyxx/Ailo340m-v4", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("xxrickyxx/Ailo340m-v4", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use xxrickyxx/Ailo340m-v4 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 xxrickyxx/Ailo340m-v4:F16 # Run inference directly in the terminal: llama cli -hf xxrickyxx/Ailo340m-v4:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf xxrickyxx/Ailo340m-v4:F16 # Run inference directly in the terminal: llama cli -hf xxrickyxx/Ailo340m-v4:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf xxrickyxx/Ailo340m-v4:F16 # Run inference directly in the terminal: ./llama-cli -hf xxrickyxx/Ailo340m-v4:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf xxrickyxx/Ailo340m-v4:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf xxrickyxx/Ailo340m-v4:F16
Use Docker
docker model run hf.co/xxrickyxx/Ailo340m-v4:F16
- LM Studio
- Jan
- vLLM
How to use xxrickyxx/Ailo340m-v4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xxrickyxx/Ailo340m-v4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xxrickyxx/Ailo340m-v4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/xxrickyxx/Ailo340m-v4:F16
- SGLang
How to use xxrickyxx/Ailo340m-v4 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 "xxrickyxx/Ailo340m-v4" \ --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": "xxrickyxx/Ailo340m-v4", "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 "xxrickyxx/Ailo340m-v4" \ --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": "xxrickyxx/Ailo340m-v4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use xxrickyxx/Ailo340m-v4 with Ollama:
ollama run hf.co/xxrickyxx/Ailo340m-v4:F16
- Unsloth Studio
How to use xxrickyxx/Ailo340m-v4 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xxrickyxx/Ailo340m-v4 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xxrickyxx/Ailo340m-v4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for xxrickyxx/Ailo340m-v4 to start chatting
- Docker Model Runner
How to use xxrickyxx/Ailo340m-v4 with Docker Model Runner:
docker model run hf.co/xxrickyxx/Ailo340m-v4:F16
- Lemonade
How to use xxrickyxx/Ailo340m-v4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull xxrickyxx/Ailo340m-v4:F16
Run and chat with the model
lemonade run user.Ailo340m-v4-F16
List all available models
lemonade list
- Atomic Chat
AILO-340M-v4
A 341M-parameter English chat model (32 layers, GPT-2 tokenizer) trained end-to-end on a single consumer AMD GPU (RX 6750 XT, 12 GB) with a hand-written backward engine β PyTorch autograd is unstable on this hardware for deep transformers.
Small enough to run on a Raspberry Pi Zero 2 W (Q4, ~220 MB) at a few tokens per second.
How it was built
A four-stage pipeline, each stage adding one capability:
- Logit distillation β a 16-layer student distilled from GPT-J 6B at the logit level (shared GPT-2 vocabulary; teacher top-64 logits precomputed offline on CPU because the teacher does not fit in 12 GB of VRAM). Held-out perplexity 39.9 β 32.1.
- Discursive chat SFT β fine-tuned on ~2,500 conversational Q&A generated by Gemma 3 4B, loss masked to answer tokens only.
- Depth expansion β 16 β 32 layers via LLaMA-Pro identity blocks (the expanded model starts mathematically identical), then re-trained on a mixed corpus: OpenAssistant, No-Robots, Dolly, Python code, MBPP, and SQuAD (which teaches exact extraction of facts and figures from a provided passage).
- Math & instruction-following β arithmetic drills, orca-math word problems, GSM8K, and constraint-following examples.
Usage
Ollama (GGUF included)
ollama run Alieno/ailo-340m-v4
Transformers
from transformers import AutoModelForCausalLM, GPT2TokenizerFast
import torch
m = AutoModelForCausalLM.from_pretrained("xxrickyxx/Ailo340m-v4", trust_remote_code=True).eval()
tok = GPT2TokenizerFast(vocab_file="vocab.json", merges_file="merges.txt")
prompt = "<|user|>\nWhy is the sky blue?\n<|assistant|>\n"
ids = tok(prompt, return_tensors="pt").input_ids
print(tok.decode(m.generate(ids, max_new_tokens=120)[0][ids.shape[1]:], skip_special_tokens=True))
Chat format: <|user|>\n{question}\n<|assistant|>\n, ending with <|end|>.
Recommended sampling: temperature 0.3, top_k 20, top_p 0.9, repeat_penalty 1.25.
What it is good at
- Conversational answers β fluent, on-topic, natural register.
- Extracting facts from a provided passage, including numbers and dates. Given a Wikipedia paragraph it will correctly return "330 metres tall" or "7 November 1867". This makes it a reasonable reader/summariser in a retrieval pipeline.
- Following output constraints β e.g. "summarise in exactly five words" (where some larger models fail).
- Basic Python structure β writes syntactically plausible functions, though often with bugs.
What it is NOT good at β please read
- Arithmetic is unreliable. Measured exact-match accuracy on unseen operands: addition 0%, subtraction 0%, percentages 0%. It will confidently produce wrong numbers (
25 + 17 = 51). - Multi-step reasoning fails on word problems and sequences.
- Factual recall from memory is unreliable β it invents dates, nationalities and details. It is markedly better when facts are supplied in the prompt.
The gap against Qwen2.5-0.5B is not mainly architectural: that model saw on the order of 18 trillion pre-training tokens, while AILO's base comes from distillation over a corpus many orders of magnitude smaller. Supervised fine-tuning shapes behaviour; it does not substitute for pre-training scale.
Use it as a small, local conversational reader β with retrieval for facts and a calculator for arithmetic. Do not use it as a source of truth.
Specs
| Parameters | 341M (32 layers, 768 hidden, 12 heads) |
| Tokenizer | GPT-2 BPE (50257) |
| Context | 1024 |
| Teachers | GPT-J 6B (logit-KD) Β· Gemma 3 4B (chat SFT) |
| Trained on | 1Γ AMD RX 6750 XT (12 GB), DirectML, manual backward |
License
CC BY-NC-SA 4.0 (non-commercial). Distilled in part from GPT-J (Apache-2.0) and Gemma 3 (Gemma Terms of Use); downstream use must respect the teachers' terms. Training data includes OpenAssistant (Apache-2.0), Dolly (CC BY-SA 3.0), No-Robots (CC BY-NC 4.0), SQuAD (CC BY-SA 4.0), GSM8K (MIT) and orca-math (MIT).
- Downloads last month
- 77