Downloads · 30 days
4
4% of all-time downloads
brayniac/promql-0.5b-onnx
promql-0.5b-onnx is a text generation model from brayniac. Use it when you need the model to write or continue text. It is set up for transformers.js. The card lists the license as apache-2.0.
A specialist fine-tune of Qwen2.5-Coder-0.5B that turns natural-language questions into PromQL over a systems-performance metrics schema (CPU, scheduler, block IO, network, syscalls, …), for in-browser inference (tran…
Downloads · 30 days
4
4% of all-time downloads
All-time downloads
106
Public
Repo size
3.5 GB
Likes
0
Public
Click a slice to open those files.
.onnx770 MB · 98%
From the Hugging Face model README
A specialist fine-tune of Qwen2.5-Coder-0.5B that turns natural-language questions into PromQL over a systems-performance metrics schema (CPU, scheduler, block IO, network, syscalls, …), for in-browser inference (transformers.js + WebGPU, ONNX/q4) — a natural-language query box for metrics.
It is schema-agnostic: the prompt supplies candidate metric "cards", and the model answers using only those names — so it generalizes to metrics it never saw in training. Gold PromQL in the training data is execution-validated, never hand-written.
import { pipeline } from '@huggingface/transformers';
const gen = await pipeline('text-generation', 'brayniac/promql-0.5b-onnx',
{ device: 'webgpu', dtype: 'q4' });
Decode greedily and stop on both <|im_end|> and <|endoftext|> (the base
eos differs from the ChatML turn terminator). Take the first non-empty line of the
completion. Ground the output to the provided card names (snap any out-of-vocab
metric identifier to the nearest provided name).
system
Convert the request into ONE PromQL query using ONLY the listed metrics.
counter -> irate(x[1s]); gauge -> x; histogram -> histogram_quantile(q, x); aggregate with sum()/avg(); filter with {label="value"}; ratio "A per B" -> sum(A_expr)/sum(B_expr).
If no listed metric answers the request, output exactly: NO_METRIC. Output only PromQL, nothing else.
user
Metrics:
<name> (<type>; labels: <k1>,<k2>) — <description>
... # includes 1–3 distractors
Request: <natural language request>
assistant = one PromQL query, or exactly NO_METRIC.
| split | semantic-equiv |
|---|---|
| in-vocab held-out phrasings (n=293) | 100.0% |
| held-out metrics never seen in training (n=466) | 98.7% |
| ONNX q4 vs torch (in-vocab) | 98.6% (torch/fp32 = 100%) |
Intents covered: lookup, total, average, by_label, filter, share (part-of-whole),
peak/min, by_index (per-CPU → heatmap), quantile, topk, ratio, derived-efficiency
KPIs (IPC/CPI, cache hit/miss rate, branch-miss rate, avg IO/packet size, frequency
scaling, cost-per-traffic), and NO_METRIC refusal.
metric_type +
result shape (histogram→percentiles/heatmap; sum by (id) multi-series→heatmap;
single series→line). The model emits PromQL only.Files: onnx/model_q4.onnx (int4, shipped) + fp32 model.onnx. A q4f16 (~half the
size) is recommended via the transformers.js conversion script.