Instructions to use ai-sage/GigaChat-20B-A3B-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ai-sage/GigaChat-20B-A3B-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ai-sage/GigaChat-20B-A3B-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ai-sage/GigaChat-20B-A3B-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ai-sage/GigaChat-20B-A3B-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ai-sage/GigaChat-20B-A3B-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-sage/GigaChat-20B-A3B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ai-sage/GigaChat-20B-A3B-instruct
- SGLang
How to use ai-sage/GigaChat-20B-A3B-instruct 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 "ai-sage/GigaChat-20B-A3B-instruct" \ --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": "ai-sage/GigaChat-20B-A3B-instruct", "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 "ai-sage/GigaChat-20B-A3B-instruct" \ --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": "ai-sage/GigaChat-20B-A3B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ai-sage/GigaChat-20B-A3B-instruct with Docker Model Runner:
docker model run hf.co/ai-sage/GigaChat-20B-A3B-instruct
Почти сразу начинает повторять себя
Repetition Penalty не помогает. Пробовал запускать с 4bit bitsandbytes и Q8 LLama.cpp - с LLama.cpp качество должно быть по-сути такое же как и в fp16.
Возможно, у вас возникли проблемы в chat template
Мы подготовили GGUF и ollama репозиторий, можете попробовать использовать модель оттуда?
• GGUF версии (bf16, q8, q6, q5, q4)
• Ollama (bf16, q8, q6, q5, q4)
Еще можно запускать в lm-studio, вот небольшой гайд.
У меня тоже начинает повотрять себя. Проблема в chat template. В llamacpp-server нет чат-темплейта для вашей модели но врод еесть возможност ьиспользовать кастомный с помощью параметра --chat-template-file . Не могли бы вы опубликовать chat-template для запуска модели?