Instructions to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru") model = AutoModelForCausalLM.from_pretrained("kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru", device_map="auto") 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
- llama.cpp
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru 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 kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16 # Run inference directly in the terminal: llama cli -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16 # Run inference directly in the terminal: llama cli -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru: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 kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16 # Run inference directly in the terminal: ./llama-cli -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru: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 kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
Use Docker
docker model run hf.co/kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
- LM Studio
- Jan
- vLLM
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
- SGLang
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru 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 "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru" \ --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": "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru", "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 "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru" \ --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": "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with Ollama:
ollama run hf.co/kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
- Unsloth Desktop
- Pi
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with Docker Model Runner:
docker model run hf.co/kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
- Lemonade
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
Run and chat with the model
lemonade run user.LFM2.5-1.2B-Instruct-T-Wix-ru-F16
List all available models
lemonade list
- Hermes Agent
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
LFM2.5-1.2B-Instruct-T-Wix-ru
⚠️ Экспериментальная версия. Учебный/исследовательский прогон без формальной оценки на бенчмарках (снимался только training loss + смоук-квизы). Не для продакшена.
Русифицированная версия LiquidAI/LFM2.5-1.2B-Instruct: LoRA SFT на русскоязычном датасете t-tech/T-Wix (~463 тыс. диалогов, english_corpus исключён; в этом прогоне использован случайный сабсэмпл 200 тыс.). Базовая модель официально поддерживает en/ar/zh/fr/de/ja/ko, но не русский — этот тюнинг адаптирует её к русскому языку.
Что улучшилось, а что нет
✅ Улучшилось:
- Русский стал беглым и структурным — базовая модель на русском выдавала грамматически сломанный текст с выдуманными словами, после тюнинга ответы связные и оформленные.
- Математические/рассуждающие ответы теперь на русском (база часто сваливалась в английский с иноязычными вставками).
- Формат вызова инструментов (
<|tool_call_start|>[func(args)]<|tool_call_end|>) в основном сохранён (9/10 на многофункциональном смоуке против 10/10 у базы).
⚠️ Известные ограничения (ожидаемы для класса 1.2B):
- Фактология на русском галлюцинирует. Причём знания в модели есть, но плохо переносятся из английского в русскоязычную генерацию: на английский тот же фактический вопрос модель отвечает корректно, а по-русски выдумывает. Для фактов на русском нужен RAG. Подробный разбор эффекта — см. issue-заметку в исходном репозитории проекта.
- Перевод EN→RU остаётся слабым (осмысленный, но с ошибками).
- Арифметика ненадёжна (может ошибаться в простых умножениях/дробях).
Структура репозитория
| Путь | Содержимое |
|---|---|
/ (корень) |
merged-модель, bf16 safetensors — для transformers / vLLM |
/lora |
LoRA-адаптер (r=32) отдельно — для подключения к базе через PEFT |
/gguf |
GGUF для llama.cpp / Ollama: F16, Q8_0 |
Запуск
transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru"
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="bfloat16", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(repo)
messages = [{"role": "user", "content": "Расскажи о Санкт-Петербурге"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=512, temperature=0.5, top_p=0.95,
do_sample=True, repetition_penalty=1.1)
print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
Рекомендации по инференсу (из смоук-тестов):
temperature=0.5,top_p=0.95,repetition_penalty=1.1— так меньше зацикливаний и иноязычных вставок.
llama.cpp
llama-cli -m lfm25-1.2b-twix-ru-q8_0.gguf -cnv -p "Ты полезный ассистент."
Детали обучения
| Параметр | Значение |
|---|---|
| Метод | LoRA SFT (Unsloth 2026.7.3 + TRL SFTTrainer) |
| LoRA | r=32, alpha=64, dropout=0 |
| target_modules | q/k/v/out_proj (attention), w1/w2/w3 (MLP), in_proj (conv-блоки LFM2) |
| Эпохи | 1 |
| Контекст | 8192 токенов, packing |
| Батч | 4 × grad_accum 8 = 32 |
| LR | 1e-4, cosine, warmup 3% |
| Оптимизатор | adamw_8bit, weight decay 0.01 |
| Точность | bf16 |
| Данные | T-Wix без english_corpus, сабсэмпл 200k диалогов |
| Финальный train loss | ~1.15 |
Инфраструктура
Обучение проводилось на облачном GPU-сервере Selectel (реферальная ссылка) — 1× NVIDIA RTX 4090 24 ГБ, ~14 часов.
EN: Experimental Russian-language adaptation of LFM2.5-1.2B-Instruct via LoRA SFT (r=32, 1 epoch, 8192 ctx, packing) on the T-Wix dataset (200k-example subsample, english_corpus excluded). The base model does not officially support Russian. Russian fluency improves markedly; however factual knowledge transfers poorly from English into Russian generation (the model answers factual questions correctly in English but hallucinates in Russian) — use RAG for Russian facts. Translation and arithmetic remain weak. Repo contains merged bf16 safetensors (root), the LoRA adapter (/lora), and GGUF F16/Q8_0 (/gguf). Research artifact, not for production.
- Downloads last month
- 173
Model tree for kaufkino/LFM2.5-1.2B-Instruct-T-Wix-ru
Base model
LiquidAI/LFM2.5-1.2B-Base