Granite 4.0 Nano Language Models
Collection
12 items โข Updated โข 1
Run mlx-community/granite-4.0-h-1b-base-bf16 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/mlx-community/granite-4.0-h-1b-base-bf16. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/mlx-community/granite-4.0-h-1b-base-bf16 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to evaluate https://huggingface.co/mlx-community/granite-4.0-h-1b-base-bf16. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to create a 4-bit version of https://huggingface.co/mlx-community/granite-4.0-h-1b-base-bf16. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
How to use mlx-community/granite-4.0-h-1b-base-bf16 with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# if on a CUDA device, also pip install mlx[cuda]
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/granite-4.0-h-1b-base-bf16")
prompt = "Once upon a time in"
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use mlx-community/granite-4.0-h-1b-base-bf16 with MLX LM:
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "mlx-community/granite-4.0-h-1b-base-bf16" --prompt "Once upon a time"
This model mlx-community/granite-4.0-h-1b-base-bf16 was converted to MLX format from ibm-granite/granite-4.0-h-1b-base using mlx-lm version 0.28.4.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/granite-4.0-h-1b-base-bf16")
prompt = "hello"
if tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)
Quantized
Base model
ibm-granite/granite-4.0-h-1b-base