Instructions to use allura-org/remnant-glm4-32b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allura-org/remnant-glm4-32b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allura-org/remnant-glm4-32b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("allura-org/remnant-glm4-32b") model = AutoModelForCausalLM.from_pretrained("allura-org/remnant-glm4-32b") 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
- vLLM
How to use allura-org/remnant-glm4-32b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allura-org/remnant-glm4-32b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allura-org/remnant-glm4-32b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/allura-org/remnant-glm4-32b
- SGLang
How to use allura-org/remnant-glm4-32b 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 "allura-org/remnant-glm4-32b" \ --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": "allura-org/remnant-glm4-32b", "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 "allura-org/remnant-glm4-32b" \ --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": "allura-org/remnant-glm4-32b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use allura-org/remnant-glm4-32b with Docker Model Runner:
docker model run hf.co/allura-org/remnant-glm4-32b
Remnant GLM4 32b (series 1)
There's a wisp of dust in the air. It feels like its from a bygone era, but you don't know where from. It lands on your tongue. It tastes nice.
Remnant is a series of finetuned LLMs focused on SFW and NSFW roleplaying and conversation.
Quants
GGUF (IF YOU ARE USING KOBOLD.CPP, PLEASE USE --nobostoken.):
EXL3:
- Todo!
EXL2 (if it ever gets supported):
- Todo!
MISC:
- Todo!
Recommended Settings
Chat template: GLM4
Samplers:
1.0temp0.1min_p
An example Sillytavern template is available here.
Credits
Humongous thanks to Allura, ilya <3
Big thanks to the developers of Axolotl (whose training framework I used), Zhipu (whose model I used), Prime Intellect (whose GPUs I used), and my bank (whose debit card I used)
Misc
See axolotl config
axolotl version: 0.8.0
# === Model Configuration ===
base_model: THUDM/GLM-4-32B-0414 # e.g. "mistralai/Mistral-Small-24B-Instruct-2501"
load_in_8bit: false
load_in_4bit: true
# === Training Setup ===
num_epochs: 2
micro_batch_size: 3
gradient_accumulation_steps: 2
sequence_len: 8192
sample_packing: true
pad_to_sequence_len: true
# === Hyperparameter Configuration ===
optimizer: adamw_8bit
# Apollo-mini configuration:
#optim_args: "proj=random,rank=1,scale=128.0,scale_type=tensor,update_proj_gap=200"
# Regular Apollo configuration:
# optim_args:
#optim_target_modules: all_linear
learning_rate: 1e-5
lr_scheduler: rex
weight_decay: 0.01
warmup_ratio: 0.05
# === LoRA Configuration ===
adapter: qlora
lora_r: 16
lora_alpha: 32
lora_dropout: 0.25
lora_target_modules:
lora_target_linear: true
# === Data Configuration ===
datasets:
- path: allura-org/inkmix-v3.0
type: chat_template
split: train
field_messages: conversations
message_field_role: from
message_field_content: value
train_on_eos: all
dataset_prepared_path: last_run_prepared
chat_template: jinja
chat_template_jinja: |
[gMASK]<sop>{%- for msg in messages %}{%- if msg.role == 'system' %}<|system|>
{{ msg.content }}{%- elif msg.role == 'user' %}<|user|>
{{ msg.content }}{%- elif msg.role == 'assistant' %}<|assistant|>
{{ msg.content }}{%- endif %}{%- endfor %}{% if add_generation_prompt %}<|assistant|>{% else %}<|user|>{% endif %}
# === Plugins ===
plugins:
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
# === Hardware Optimization ===
gradient_checkpointing: offload
gradient_checkpointing_kwargs:
use_reentrant: false
cut_cross_entropy: true
deepspeed: deepspeed_configs/zero3_bf16.json
# === Wandb Tracking ===
wandb_project: glm4-32b-inkmix-v3
# === Checkpointing ===
saves_per_epoch: 2
save_total_limit: 3
# === Advanced Settings ===
output_dir: /workspace/ckpts
bf16: auto
flash_attention: true
train_on_inputs: false
group_by_length: false
logging_steps: 1
trust_remote_code: true
- Downloads last month
- 13
