AI NewsDev toolsAnnouncement

gpu-time is a 44 KB neural date parser that runs in browsers

gpu-time is a new MIT-licensed neural parser for English time expressions that runs in the browser on WebGPU or CPU, is delivered as a 44,682-byte Brotli bundle, and returns dates, ranges, and RFC 5545 recurrence rules without a server call.

AI News

Editorial3 min read

LinkedInX
GitHub social card for the gpu-time repository

Image: GitHub

Why it mattersA reminder field or command bar can accept messy phrases like "Sat Sun 1pm to 8pm Mon 10pm to 12am" and get back a schedule locally, so the input never leaves the page.

Arik Chakma published gpu-time, a small trained parser that turns English time expressions into dates, ranges, and RFC 5545 recurrence rules. The repository went up on GitHub on 11 September under an MIT license and reached 144 stars in the two days since. The parser runs on the caller's own machine, on CPU or through WebGPU, and does not send input to a server.

What it does

The library exports parse(text, context) and parseMany(texts, context). The caller supplies the reference instant, a timezone name, and a maximum number of previewed occurrences. The result carries occurrences as ISO start and end strings, rrules as RFC 5545 properties for repeating expressions, diagnostics explaining any rejected expression, and spans giving the character offsets each answer was read from. An unknown timezone makes the call fail rather than using a default.

A single input can carry several schedules. The README shows Sat Sun 1pm-8pm Mon 10pm-12am returning the four expected time ranges from one call.

How small it is

The published package is 44,682 Brotli bytes for the whole runtime, below its own 50,000-byte release cap. The trained model itself is 22,519 Brotli bytes and holds 38,745 parameters, two scan layers, and a 40-by-40 role transition matrix for Viterbi decoding on the CPU. Weights use 6-bit symmetric per-tensor quantization with f32 intermediates. There is no word list in the model. The tokenizer never imports the lexicon, so a month name reaches the model as spelling alone and the network learns to recognise it from the letters themselves.

What the numbers say

The model card reports 5,791 out of 6,011 exact schedules on a real English holdout of labelled sentences drawn from a public corpus and never shown to training. That is 96.3 percent, up from 5,399 out of 6,011 on the earlier checkpoint the current model was warm-started from. On the Microsoft Recognizers development agreement suite, the parser scores 229 out of 563, which the model card explicitly describes as a comparison of interpretation rules rather than of capability, since policy differences count as failures.

Warm medians over 10,000 inputs put WebGPU at 122.4 ms, CPU at 993.9 ms, and Chrono, an existing JavaScript rule-based parser, at 89.2 ms. The author calls this a timing comparison, because the other parsers return different structures. The WebGPU path sits within about 35 ms of Chrono while returning RFC 5545 recurrence rules the rule-based parser cannot express.

backend: "auto" tries WebGPU once a batch reaches 32 inputs or 512 tokens, and stays on CPU below that, where the time to send work to the device and read it back is the main cost. "webgpu" forces the GPU path and disables the internal CPU fallback, so the caller handles both the missing-WebGPU case and the loss of the device mid-session.

The library is aimed at reminder fields, schedule forms, and command bars. The model card lists what it is not for: parsing documents, extracting dates from long prose, and any legal, medical, or billing decision where a wrong or invented date has real consequences. English only, and vague phrases such as ASAP or "after work" are returned with no clock value.

For a team already sending free-text scheduling input to a server for parsing, the same input can now be resolved on the page in tens to hundreds of milliseconds, with the reference instant and timezone supplied by the caller and never seen by the model. That removes one request to the server from a scheduling flow and keeps the raw text out of a log entirely.

Source

Primary source: arikchakma/gpu-time on GitHub. Details cited above come from the repository's README and MODEL_CARD.md.

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project