Run this model with HF Jobs
Run wesjos/granite-4.2-3b-HTML 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:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/wesjos/granite-4.2-3b-HTML. 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.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/wesjos/granite-4.2-3b-HTML 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.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/wesjos/granite-4.2-3b-HTML. 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.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/wesjos/granite-4.2-3b-HTML. 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.
Instructions to use wesjos/granite-4.2-3b-HTML with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wesjos/granite-4.2-3b-HTML with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wesjos/granite-4.2-3b-HTML") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("wesjos/granite-4.2-3b-HTML") model = AutoModelForCausalLM.from_pretrained("wesjos/granite-4.2-3b-HTML", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wesjos/granite-4.2-3b-HTML with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wesjos/granite-4.2-3b-HTML" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wesjos/granite-4.2-3b-HTML", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wesjos/granite-4.2-3b-HTML
- SGLang
How to use wesjos/granite-4.2-3b-HTML 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 "wesjos/granite-4.2-3b-HTML" \ --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": "wesjos/granite-4.2-3b-HTML", "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 "wesjos/granite-4.2-3b-HTML" \ --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": "wesjos/granite-4.2-3b-HTML", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wesjos/granite-4.2-3b-HTML with Docker Model Runner:
docker model run hf.co/wesjos/granite-4.2-3b-HTML
Download webui/README.md from wesjos/granite-4.2-3b-HTML: direct link, hf CLI and curl.
- Browser
- Download file 2.41 kB
-
https://huggingface.co/wesjos/granite-4.2-3b-HTML/resolve/main/webui/README.md
- Command line
-
hf download hf://wesjos/granite-4.2-3b-HTML/webui/README.md
-
curl -L -o README.md https://huggingface.co/wesjos/granite-4.2-3b-HTML/resolve/main/webui/README.md
Mario-HTML WebUI
A single-file FastAPI chat UI for granite-4.2-3b-HTML. It is model-agnostic: point it at any
OpenAI-compatible endpoint (/v1) and it renders that model's output.
Features
- Split reasoning and answer — the
<think> … </think>stream is routed into a collapsible Chain of Thought panel, and everything after it is rendered as HTML. - HTML card canvas — the answer body is rendered live inside a canvas, so
ai-viewcards, callouts, tables and steppers look the way the model designed them. - Themes and custom CSS — built-in presets (
default,notion,editorial,apple,cyber) plus a free-formcustom_cssfield. - Sampling panel — temperature, top-p, top-k, min-p, presence/repetition penalty, max tokens and a CoT Reasoning on/off switch.
- Two backend modes —
api(talk to a running vLLM / llama.cpp server) ordirect(let the UI start a managedllama-serveron a local GGUF).
Quick start
1. Serve the model
# transformers checkpoint in this repo
vllm serve . --served-model-name granite-4.2-3b-HTML \
--max-model-len 65536 --gpu-memory-utilization 0.9
2. Serve the UI
cd webui
pip install -r requirements.txt
./run_webui.sh # or: python server.py --port 8791
Open http://localhost:8791.
config.json is the single source of truth — api_url, model_alias, context_size,
sampling defaults, theme and CSS all live there. Environment variables
(API_URL, MODEL_PATH, MODEL_ALIAS, WEBUI_PORT, WEBUI_PY) override it when you need a
one-off run.
Files
| File | Purpose |
|---|---|
server.py |
All backend logic (single file) |
static/index.html |
Frontend (single HTML + JS file) |
static/theme.css |
Base theme |
config.json |
Runtime config (backend URL, sampling, theme) |
run_webui.sh |
Self-contained launcher |
requirements.txt |
Python dependencies |
Notes
enable_thinkingis forwarded to the backend aschat_template_kwargs.enable_thinking, so the model card'senable_thinking=falseshortcut (pre-closed empty think block → straight to the HTML card) works the same way here.- With
enable_thinking=truethe chat template pre-fills an opening<think>, so the opening tag is not part of the generated stream — the UI handles that shape as well as the "tags inside the output" shape.