Instructions to use anakin87/LFM2-2.6B-ttt-rl-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anakin87/LFM2-2.6B-ttt-rl-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anakin87/LFM2-2.6B-ttt-rl-merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("anakin87/LFM2-2.6B-ttt-rl-merged") model = AutoModelForMultimodalLM.from_pretrained("anakin87/LFM2-2.6B-ttt-rl-merged") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anakin87/LFM2-2.6B-ttt-rl-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anakin87/LFM2-2.6B-ttt-rl-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anakin87/LFM2-2.6B-ttt-rl-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/anakin87/LFM2-2.6B-ttt-rl-merged
- SGLang
How to use anakin87/LFM2-2.6B-ttt-rl-merged 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 "anakin87/LFM2-2.6B-ttt-rl-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anakin87/LFM2-2.6B-ttt-rl-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "anakin87/LFM2-2.6B-ttt-rl-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anakin87/LFM2-2.6B-ttt-rl-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use anakin87/LFM2-2.6B-ttt-rl-merged with Docker Model Runner:
docker model run hf.co/anakin87/LFM2-2.6B-ttt-rl-merged
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 "anakin87/LFM2-2.6B-ttt-rl-merged" \
--host 0.0.0.0 \
--port 30000# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "anakin87/LFM2-2.6B-ttt-rl-merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'LFM2-2.6B-ttt-rl-merged
Merged standalone model after the first round of CISPO training for Tic Tac Toe.
This is the result of merging anakin87/LFM2-2.6B-ttt-rl (LoRA adapter) into anakin87/LFM2-2.6B-ttt-sft (SFT base). It serves as the base for the second round of RL training.
This is an intermediate checkpoint from 🎓 LLM RL Environments Lil Course, a hands-on course on building RL environments for Language Models, where models learn from rewards, not examples. It walks through the full process of turning a small open model into a specialist that outperforms a large proprietary one on a specific task (Tic Tac Toe). The final model is anakin87/LFM2-2.6B-mr-tictactoe.
🤗🕹️ Play against the final model
Evaluation
100 games per setting.
| Model vs random opponent | % Wins | % Draws | % Losses | % Follows format | % Games w invalid moves |
|---|---|---|---|---|---|
| LiquidAI/LFM2-2.6B | 40 | 11 | 49 | 27.8 | 40 |
| anakin87/LFM2-2.6B-ttt-sft | 74 | 13 | 13 | 99.8 | 11 |
| anakin87/LFM2-2.6B-ttt-rl-merged | 86 | 12 | 2 | 100 | 1 |
| Model vs optimal opponent | % Wins | % Draws | % Losses | % Follows format | % Games w invalid moves |
| LiquidAI/LFM2-2.6B | 0 | 11 | 89 | 24.7 | 43 |
| anakin87/LFM2-2.6B-ttt-sft | 0 | 52 | 48 | 99 | 14 |
| anakin87/LFM2-2.6B-ttt-rl-merged | 0 | 85 | 15 | 100 | 1 |
Competent player, but still falls into fork traps against the optimal opponent.
- Downloads last month
- 2
Model tree for anakin87/LFM2-2.6B-ttt-rl-merged
Base model
LiquidAI/LFM2-2.6B
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "anakin87/LFM2-2.6B-ttt-rl-merged" \ --host 0.0.0.0 \ --port 30000# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anakin87/LFM2-2.6B-ttt-rl-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'