Text Generation
Transformers
Safetensors
Russian
qwen3
mining
awq
conversational
text-generation-inference
4-bit precision
Instructions to use nn-tech/MetalGPT-1-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nn-tech/MetalGPT-1-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nn-tech/MetalGPT-1-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nn-tech/MetalGPT-1-AWQ") model = AutoModelForCausalLM.from_pretrained("nn-tech/MetalGPT-1-AWQ") 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
- vLLM
How to use nn-tech/MetalGPT-1-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nn-tech/MetalGPT-1-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nn-tech/MetalGPT-1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nn-tech/MetalGPT-1-AWQ
- SGLang
How to use nn-tech/MetalGPT-1-AWQ 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 "nn-tech/MetalGPT-1-AWQ" \ --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": "nn-tech/MetalGPT-1-AWQ", "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 "nn-tech/MetalGPT-1-AWQ" \ --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": "nn-tech/MetalGPT-1-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nn-tech/MetalGPT-1-AWQ with Docker Model Runner:
docker model run hf.co/nn-tech/MetalGPT-1-AWQ
Description
MetalGPT-1 is a model built upon the Qwen/Qwen3-32B and incorporates both continual pre-training and supervised fine-tuning on domain-specific data from the mining and metallurgy industry.
Quantization
For convenience and better efficiency, we also offer this AWQ-quantized checkpoint of the nn-tech/MetalGPT-1 model. Using AWQ 4-bit quantization greatly speeds up inference and reduces memory consumption, without significant impact on quality.
HF Usage
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer
import torch
torch.manual_seed(42)
model_name = "nn-tech/MetalGPT-1-AWQ"
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=True)
model = AutoAWQForCausalLM.from_quantized(
model_name,
device_map="auto",
)
messages=[
{"role": "system", "content": "Ты специалист в области металлургии."},
{"role": "user", "content": "Назови плюсы и минусы хлоридной и сульфатной технологии производства никеля."}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
# enable_thinking=False
)
device = next(model.parameters()).device
model_inputs = tokenizer([text], return_tensors="pt").to(device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=1024,
do_sample=True,
temperature=0.7,
)
# Обрезаем префикс промпта
generated_ids = [
output_ids[len(input_ids):]
for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(
generated_ids,
skip_special_tokens=True
)[0]
print(response)
VLLM usage
vllm serve nn-tech/MetalGPT-1-AWQ --reasoning-parser qwen3
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="dummy"
)
response = client.chat.completions.create(
model="nn-tech/MetalGPT-1-AWQ",
messages=[
{"role": "system", "content": "Ты специалист в области металлургии."},
{"role": "user", "content": "Назови плюсы и минусы хлоридной и сульфатной технологии производства никеля."}
],
temperature=0.7,
max_tokens=1024
)
print(response.choices[0].message.content)
- Downloads last month
- 91