Text Generation
Transformers
Safetensors
Russian
English
qwen3
conversational
text-generation-inference
Instructions to use Vikhrmodels/QVikhr-3-8B-Instruction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vikhrmodels/QVikhr-3-8B-Instruction with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vikhrmodels/QVikhr-3-8B-Instruction") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Vikhrmodels/QVikhr-3-8B-Instruction") model = AutoModelForCausalLM.from_pretrained("Vikhrmodels/QVikhr-3-8B-Instruction", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Vikhrmodels/QVikhr-3-8B-Instruction with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vikhrmodels/QVikhr-3-8B-Instruction" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vikhrmodels/QVikhr-3-8B-Instruction", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Vikhrmodels/QVikhr-3-8B-Instruction
- SGLang
How to use Vikhrmodels/QVikhr-3-8B-Instruction 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 "Vikhrmodels/QVikhr-3-8B-Instruction" \ --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": "Vikhrmodels/QVikhr-3-8B-Instruction", "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 "Vikhrmodels/QVikhr-3-8B-Instruction" \ --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": "Vikhrmodels/QVikhr-3-8B-Instruction", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Vikhrmodels/QVikhr-3-8B-Instruction with Docker Model Runner:
docker model run hf.co/Vikhrmodels/QVikhr-3-8B-Instruction
| library_name: transformers | |
| model_name: QVikhr-3-8B-Instruction | |
| base_model: | |
| - Qwen/Qwen3-8B | |
| language: | |
| - ru | |
| - en | |
| license: apache-2.0 | |
| datasets: | |
| - Vikhrmodels/GrandMaster2 | |
| # QVikhr-3-8B-Instruction | |
| Инструктивная модель на основе **Qwen/Qwen3-8B**, обученная на русскоязычном датасете **GrandMaster2**. Создана для высокоэффективной обработки текстов на русском и английском языках, обеспечивая точные ответы и быстрое выполнение задач. | |
| ## Quantized variants: | |
| - GGUF [Vikhrmodels/QVikhr-3-8B-Instruction-GGUF](https://huggingface.co/Vikhrmodels/QVikhr-3-8B-Instruction-GGUF) | |
| - MLX | |
| - 4 bit [Vikhrmodels/QVikhr-3-8B-Instruction-MLX_4bit](https://huggingface.co/Vikhrmodels/QVikhr-3-8B-Instruction-MLX_4bit) | |
| - 8 bit [Vikhrmodels/QVikhr-3-8B-Instruction-MLX_8bit](https://huggingface.co/Vikhrmodels/QVikhr-3-8B-Instruction-MLX_8bit) | |
| ## Особенности: | |
| - 📚 Основа / Base: [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) | |
| - 🇷🇺 Специализация / Specialization: **RU** | |
| - 💾 Датасет / Dataset: [GrandMaster2](https://huggingface.co/datasets/Vikhrmodels/GrandMaster2) | |
| - 🌍 Поддержка / Support: **Bilingual RU/EN** | |
| ## Попробовать: | |
| [](https://colab.research.google.com/drive/1DvostFGC_7jnziSUaZ0gJnADhOi5lrSD?usp=sharing) | |
| ## DOoM | |
| | model | score | math_score |physics_score | | |
| |------------------------------------------|-------|-----------|--------------| | |
| | gpt-4.1 |0.466 |0.584 |0.347 | | |
| | QVikhr-3-8B-Instruction |0.445 |0.563 |0.327 | | |
| | Qwen3-8B |0.417 |0.538 |0.296 | | |
| | Gemma 3 27B |0.4 |0.474 |0.327 | | |
| ## Описание / Description: | |
| **QVikhr-3-8B-Instruction** — мощная языковая модель, обученная на датасете **GrandMaster-2**, поддерживает генерацию инструкций, контекстные ответы и анализ текста на русском языке. Эта модель оптимизирована для задач инструктивного обучения и обработки текстов. Она подходит для использования в профессиональной среде, а также для интеграции в пользовательские приложения и сервисы. | |
| Модель построена на базе архитектуры [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) и была дообучена на большом русскоязычном датасете [GrandMaster2](https://huggingface.co/datasets/Vikhrmodels/GrandMaster2). Такое специализированное обучение значительно улучшило её способность генерировать точные, контекстно-зависимые ответы и быстро выполнять задачи на русском языке. | |
| Тесты производительности подтверждают значительные улучшения модели. В рейтинге «DOoM» QVikhr-3-8B-Instruction получила оценку 0.445, что существенно превосходит результат базовой модели Qwen3-8B, и приближается к модели gpt-4.1. Это доказывает её превосходные возможности для решения задач связанные с математикой и физикой на русском языке. | |
| ## Обучение: | |
| **QVikhr-3-8B-Instruction** была создана с использованием метода SFT (Supervised Fine-Tuning). Мы использовали синтетический датасет **GrandMaster-2**. | |
| ## Пример кода для запуска: | |
| **Рекомендуемая температура для генерации: 0.3**. | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| # Load the model and tokenizer | |
| model_name = "Vikhrmodels/QVikhr-3-8B-Instruction" | |
| model = AutoModelForCausalLM.from_pretrained(model_name) | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| # Prepare the input text | |
| input_text = "Напиши краткое описание книги Гарри Поттер." | |
| messages = [ | |
| {"role": "user", "content": input_text}, | |
| ] | |
| # Tokenize and generate text | |
| input_ids = tokenizer.apply_chat_template(messages, truncation=True, add_generation_prompt=True, return_tensors="pt") | |
| output = model.generate( | |
| input_ids, | |
| max_length=4096, | |
| temperature=0.3, | |
| num_return_sequences=1, | |
| no_repeat_ngram_size=2, | |
| top_k=50, | |
| top_p=0.95, | |
| ) | |
| # Decode and print result | |
| generated_text = tokenizer.decode(output[0], skip_special_tokens=True) | |
| print(generated_text) | |
| ```` | |
| ### Авторы | |
| - Sergei Bratchikov, [NLP Wanderer](https://t.me/nlpwanderer), [Vikhr Team](https://t.me/vikhrlabs) | |
| - Nikolay Kompanets, [LakoMoor](https://t.me/lakomoordev), [Vikhr Team](https://t.me/vikhrlabs) | |
| - Konstantin Korolev, [Vikhr Team](https://t.me/vikhrlabs) | |
| - Aleksandr Nikolich, [Vikhr Team](https://t.me/vikhrlabs) | |
| ### Ссылки | |
| [Vikhr](https://vikhr.org) | |
| [Vikhr Telegram](https://t.me/vikhrlabs) | |
| [Донаты](https://www.tbank.ru/cf/3W1Ko1rj8ah) | |
| ### Как цитировать | |
| ```bibtex | |
| @inproceedings{nikolich2024vikhr, | |
| title={Vikhr: Advancing Open-Source Bilingual Instruction-Following Large Language Models for Russian and English}, | |
| author={Aleksandr Nikolich and Konstantin Korolev and Sergei Bratchikov and Nikolay Kompanets and Igor Kiselev and Artem Shelmanov}, | |
| booktitle={Proceedings of the 4th Workshop on Multilingual Representation Learning (MRL) @ EMNLP-2024}, | |
| year={2024}, | |
| publisher={Association for Computational Linguistics}, | |
| url={[https://arxiv.org/pdf/2405.13929](https://arxiv.org/pdf/2405.13929)} | |
| } | |
| @misc{qwen3technicalreport, | |
| title={Qwen3 Technical Report}, | |
| author={Qwen Team}, | |
| year={2025}, | |
| eprint={2505.09388}, | |
| archivePrefix={arXiv}, | |
| primaryClass={cs.CL}, | |
| url={https://arxiv.org/abs/2505.09388}, | |
| } | |
| ``` |