Instructions to use zeromodels/glm-4.5-air-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use zeromodels/glm-4.5-air-base with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/glm-4.5-air-base") - Notebooks
- Google Colab
- Kaggle
Run GLM-4.5 with Keras 3: JAX, PyTorch, or TensorFlow
zeromodels/glm-4.5-air-base
Pure-Keras 3 conversion of zai-org/GLM-4.5-Air-Base for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX. This is the GLM-4.5-Air-Base mixture-of-experts checkpoint served as text -> text; weights are stored in bfloat16, with the mixture-of-experts router correction bias kept in float32 (matching the upstream mixed-precision checkpoint). See zm_config.json (weight_dtype + weight_dtype_overrides) for the exact layout.
For model details, license, and usage terms, see the upstream model card.
Paper: ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools (arXiv:2406.12793) · HF Papers
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.glm4_moe import Glm4MoeTextGenerate, Glm4MoeTokenizer
model = Glm4MoeTextGenerate.from_weights("zeromodels/glm-4.5-air-base")
tokenizer = Glm4MoeTokenizer.from_weights("zeromodels/glm-4.5-air-base")
messages = [{"role": "user", "content": "Name three prime numbers."}]
inputs = tokenizer(messages)
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0]))
Load any GLM variant the same way with from_weights("zeromodels/<variant>"). Browse them all in the GLM collection.
Special Thanks
A huge thank you to the Zhipu AI / THUDM team for creating and releasing the GLM models.
License: mit (per the upstream model card).
Model tree for zeromodels/glm-4.5-air-base
Base model
zai-org/GLM-4.5-Air-Base