Text Generation
Transformers
Safetensors
GGUF
Russian
gemma3_text
gemma3
tiny-model
russian
chat
fine-tuned
vocabulary-pruning
model-soup
salgrai
conversational
text-generation-inference
Instructions to use salgr/SalgrAI_v2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use salgr/SalgrAI_v2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="salgr/SalgrAI_v2.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("salgr/SalgrAI_v2.1") model = AutoModelForCausalLM.from_pretrained("salgr/SalgrAI_v2.1", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use salgr/SalgrAI_v2.1 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 salgr/SalgrAI_v2.1:Q4_K_M # Run inference directly in the terminal: llama cli -hf salgr/SalgrAI_v2.1:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf salgr/SalgrAI_v2.1:Q4_K_M # Run inference directly in the terminal: llama cli -hf salgr/SalgrAI_v2.1:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf salgr/SalgrAI_v2.1:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf salgr/SalgrAI_v2.1:Q4_K_M
Use Docker
docker model run hf.co/salgr/SalgrAI_v2.1:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use salgr/SalgrAI_v2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "salgr/SalgrAI_v2.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "salgr/SalgrAI_v2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/salgr/SalgrAI_v2.1:Q4_K_M
- SGLang
How to use salgr/SalgrAI_v2.1 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 "salgr/SalgrAI_v2.1" \ --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": "salgr/SalgrAI_v2.1", "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 "salgr/SalgrAI_v2.1" \ --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": "salgr/SalgrAI_v2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use salgr/SalgrAI_v2.1 with Ollama:
ollama run hf.co/salgr/SalgrAI_v2.1:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use salgr/SalgrAI_v2.1 with Docker Model Runner:
docker model run hf.co/salgr/SalgrAI_v2.1:Q4_K_M
- Lemonade
How to use salgr/SalgrAI_v2.1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull salgr/SalgrAI_v2.1:Q4_K_M
Run and chat with the model
lemonade run user.SalgrAI_v2.1-Q4_K_M
List all available models
lemonade list
- Atomic Chat
File size: 1,154 Bytes
b87f745 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | """Minimal chat with SalgrAI-v2.1 (transformers). Run: python chat_example.py [path-or-repo]. Commands: /reset, /exit."""
import sys
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = sys.argv[1] if len(sys.argv) > 1 else "."
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16).eval()
history = []
while True:
try:
text = input("you> ").strip()
except EOFError:
break
if text == "/exit":
break
if text == "/reset":
history = []
continue
if not text:
continue
history.append({"role": "user", "content": text})
inputs = tok.apply_chat_template(history, add_generation_prompt=True, return_tensors="pt", return_dict=True)
inputs.pop("token_type_ids", None)
with torch.no_grad():
out = model.generate(**inputs) # sampling settings come from generation_config.json
reply = tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip()
history.append({"role": "assistant", "content": reply})
history = history[-8:]
print("ai>", reply)
|