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.
wesjos's picture
add webui + demo (webui/README.md)
d265d76 verified
|
Raw History Blame Contribute Delete
2.41 kB

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-view cards, 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-form custom_css field.
  • 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) or direct (let the UI start a managed llama-server on 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_thinking is forwarded to the backend as chat_template_kwargs.enable_thinking, so the model card's enable_thinking=false shortcut (pre-closed empty think block → straight to the HTML card) works the same way here.
  • With enable_thinking=true the 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.