Text Generation
PEFT
Safetensors
Transformers
qwen3
lora
sft
trl
unsloth
conversational
text-generation-inference
Instructions to use CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-1.7B") model = PeftModel.from_pretrained(base_model, "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse") - Transformers
How to use CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse") model = AutoModelForCausalLM.from_pretrained("CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse") 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 CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse
- SGLang
How to use CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse 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 "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse" \ --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": "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse", "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 "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse" \ --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": "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse", max_seq_length=2048, ) - Docker Model Runner
How to use CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse with Docker Model Runner:
docker model run hf.co/CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse
metadata
base_model: Qwen/Qwen3-1.7B
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:Qwen/Qwen3-1.7B
- lora
- sft
- transformers
- trl
- unsloth
CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse
Part of the CoNDeNse project — compressing the reasoning capability of large models into small, deployable ones.
Model Details
- Base model: Qwen/Qwen3-1.7B
- Method: LoRA (r=32, α=64)
- Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- Dtype: float16
Training
- Dataset: Jackrong/GLM-5.1-Reasoning-1M-Cleaned (75,000 examples)
- Optimizer: AdamW 8-bit
- Learning rate: 2e-4 with cosine scheduler
- Batch size: 1 × 16 gradient accumulation (effective batch = 16)
- Max sequence length: 4096
- Packing: enabled
Notes
May HALLUCINATE
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-1.7B",
torch_dtype=torch.float16,
device_map="cuda",
)
tokenizer = AutoTokenizer.from_pretrained("CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse")
model = PeftModel.from_pretrained(base_model, "CoNDeNse-AI/GLM-5.1-Qwen3-1.7B-CoNDeNse")
prompt = "<|im_start|>user\nYour question here<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))