HeadlineGPT — ONNX / WebGPU
Browser-ready ONNX export of
csankalp21/headlinegpt, a Qwen2.5-1.5B-Instruct model fine-tuned for generating concise, engaging titles.
This version is designed for
local, in-browser inference using WebGPU with
Transformers.js.
Your content can be processed entirely on the user's device without sending it to a remote inference server.
See the
main HeadlineGPT model card for training details and model limitations.
Model Format
| Property | Value |
|---|
| Base model | Qwen2.5-1.5B-Instruct |
| Format | ONNX |
| Precision | FP16 |
| Export task | text-generation-with-past |
| Approximate size | 3.7 GB |
| Intended runtime | Transformers.js / ONNX Runtime Web |
| Hardware acceleration | WebGPU |
The current release uses FP16 weights. A smaller quantized version may be released separately.
Browser Usage
Install Transformers.js:
1npm install @huggingface/transformers
2
3
4```javascript
5import { pipeline } from "@huggingface/transformers";
6
7const generator = await pipeline(
8 "text-generation",
9 "csankalp21/headlinegpt-onnx",
10 {
11 device: "webgpu",
12 dtype: "fp16",
13 }
14);
15
16const messages = [
17 {
18 role: "system",
19 content: "You are an expert at writing highly engaging titles."
20 },
21 {
22 role: "user",
23 content:
24 "Generate a high-engagement title for the following content:\n\n" +
25 "<your content here>"
26 }
27];
28
29const output = await generator(messages, {
30 max_new_tokens: 40,
31 temperature: 0.7,
32 do_sample: true,
33 top_p: 0.9,
34 repetition_penalty: 1.1,
35});
36
37console.log(output);
Local Inference
Inference runs in the browser using the user's GPU through WebGPU.
No API key or inference server is required for browser-local inference.
After the model files have been downloaded, they can be cached locally by the browser for subsequent use.
Python / ONNX Runtime
The model can also be loaded with Optimum and ONNX Runtime:
1from optimum.onnxruntime import ORTModelForCausalLM
2from transformers import AutoTokenizer
3
4model_id = "csankalp21/headlinegpt-onnx"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7
8model = ORTModelForCausalLM.from_pretrained(
9 model_id
10)
Example
Input:
Apple is developing a new generation of artificial intelligence tools designed to make its devices more useful and personalized.
Generated title:
Apple's New AI Tools Will Make Your Devices More Useful
Performance & Requirements
WebGPU support and performance depend on the user's browser, operating system, GPU, available VRAM, and browser implementation.
The FP16 model is approximately 3.7 GB, so the initial download can be substantial. Model files may be cached locally by the browser after the first download.
Limitations
- English-focused; performance may vary substantially on other languages.
- Quality can vary outside the content distribution used during training.
- The model may occasionally introduce details that are not explicitly present in the source content.
- Engagement-oriented titles are not guaranteed to achieve higher engagement.
- Browser performance varies significantly across devices.
- The current FP16 release requires a relatively large initial download.
- WebGPU availability depends on browser and hardware support.
Related Models and Resources
- Main model: csankalp21/headlinegpt
- Transformers.js: Documentation
- Qwen2.5-1.5B-Instruct: Base model
License
Apache 2.0.
Please also review the license and usage terms of the underlying
Qwen2.5-1.5B-Instruct model.