Skip to content
volko

Work On-Prem LLM Inference · proprietary

ayLLM — Natural-Language PACS Search

A fully-local natural-language query interface for the PACS database — fine-tuned 270M Gemma, three-stage NL → JSON → SQL, no cloud API and no equivalent shipping from any commercial vendor.

270M

fine-tuned Gemma · Q4_0 GGUF

10K

synthetic training pairs

0 cloud

fully local · HIPAA-safe

The aycan PACS study browser: a structured search form with Patient Name, ID, Birthdate, Accession, Study Date and Modality fields above a results table of anonymized demo studies, with the ayLLM 'AI Assistant' chat panel docked on the right.
ayLLM embeds a fine-tuned, locally-hosted Gemma model as an AI Assistant inside the PACS search UI, turning plain-language queries into the same parameterized filters the form exposes as SQL. Shown on a synthetic demo dataset — no real patient data.

Problem

Finding studies means knowing the query language. Radiology staff want to ask in plain English — “MRIs for Smith last month” — but the data is PHI, so a cloud LLM is off the table. No commercial PACS vendor ships a local natural-language query interface.

Architecture

A three-stage local-inference pipeline that never emits raw model SQL.

  • Stage 1 — NL → JSON: a fine-tuned Gemma 270M (chat-format, near-deterministic) emits a structured intent object, with JSON repair for missing keys.
  • Stage 2 — JSON → SQL: field names map through a schema dictionary into parameterized SQL (%s placeholders, ILIKE for case-insensitive match) — the model never writes executable SQL directly, which keeps it safe and validatable.
  • Stage 3 — execution: runs through the existing as_dal PostgreSQL layer against the live Store.

A 270M model is viable because the domain is narrow — a single table — and the intermediate JSON gives a validation seam. Training data is 10,000 synthetic NL/JSON pairs across basic, multi-field, and aggregation templates.

Results

End-to-end natural-language search over the PACS database, quantized to Q4_0 for minimal memory and running entirely on local hardware — zero cloud calls.

Impact

A query interface no vendor offers, built to a hard constraint: patient data never leaves the building.