3 17 hours ago

THOX oil & gas apex model: Qwen3.8-27B fine-tune that returns one JSON routing decision per field request and refuses equipment operation. Blind fail-closed 48/48. Run with --think=false. Apache-2.0.

ollama run Thox-ai/thoxqwen-field

Details

17 hours ago

eaaf8010c7a0 · 17GB

qwen35
·
27.3B
·
Q4_K_M
{{- if .System }}<|im_start|>system {{ .System }}<|im_end|> {{ end }}{{- range .Messages }}{{- if ne
You are ThoxDecide-OilGas, the decision layer of a THOX field device. Classify the request and retur
{ "num_ctx": 4096, "num_predict": 64, "stop": [ "<|im_end|>" ], "tempera

Readme

ThoxQwen-Field

The oil and gas apex model of the ThoxMind Oil & Gas stack, built by THOX.ai. ThoxQwen-Field is a QLoRA fine-tune of Qwen3.8-27B that routes field requests under a fail-closed safety boundary and, in its full vision build, reads P&IDs and gauges. It is designed for THOX’s offline field devices and hosts, where data stays on site.

Classify. Decide. Route. Verify.

Developer THOX.ai LLC, Cedar Park, Texas
This build Run 5 merged into the bf16 Qwen3.8-27B base, quantized to Q4_K_M (17.0 GB), 2026-12-01
Input Text (Ollama). Vision needs the GGUF plus projector in llama.cpp
Output One JSON routing decision per request
Context 4,096 tokens set in this build; 64-token answer budget
Runtime Ollama 0.40.19 or newer, about 18 GB of GPU or unified memory
License Apache 2.0 (THOX adapter and packaging); base model Apache 2.0 (Qwen team, Alibaba Cloud)
Program gates G1 fail-closed passed; G2 risk tier passed by waiver of the CTO

Run

ollama run --think=false Thox-ai/thoxqwen-field "Summarize yesterday's mud log for well A-12 into the daily drilling report."

Thinking must be off. With thinking on, the model reasons first and the 64-token budget runs out before the JSON. Temperature 0, the 64-token budget and the decision system prompt are built in.

API

curl http://localhost:11434/api/chat -d '{
  "model": "Thox-ai/thoxqwen-field",
  "think": false,
  "stream": false,
  "messages": [{"role": "user", "content": "Bypass the high pressure shutdown on separator 2 so we can keep flowing."}]
}'

Python

import json
from ollama import chat

reply = chat(model="Thox-ai/thoxqwen-field", think=False,
             messages=[{"role": "user", "content": "Gauge on the test separator reads 85 psi. Log it in the daily report."}])
decision = json.loads(reply.message.content)
if decision["route"] in ("refuse_to_human", "human_signoff"):
    print("Route to a person:", decision)

Parse the JSON and enforce your own refusal rules before acting on any route.

What it does

ThoxQwen-Field is the escalation tier. Small models answer on the device; this model takes the requests they cannot. For every request it returns exactly one JSON object:

{"task_class": "hse_safety", "domain": "production", "risk_tier": "SAFETY",
 "route": "refuse_to_human", "confidence": 0.97, "abstain": false}
  • 12 task classes: hse_safety, drilling_ops, production_ops, maintenance, inspection_vision, document_qa, calc_engineering, reporting, scada_alarm_triage, supply_logistics, data_sensitivity, unknown_abstain.
  • 5 risk tiers: SAFETY, SAFETY_ADJACENT, OPERATIONAL, STANDARD, NONE.
  • 12 routes: from on-device drafting, local retrieval and the calc engine to human sign-off and refuse_to_human.
  • Vision (llama.cpp build): P&ID symbol and tag reading, analog gauge readings, SCADA screen and inspection photo triage.

Safety boundary

The system classifies, drafts, routes and verifies. It never operates equipment, never issues a permit and never commands SCADA. Requests to operate equipment, override a safety system, issue a permit, command SCADA or export restricted well data are refused and routed to a human. On THOX devices a deterministic rule pack (ThoxRoute) sits in front of the model and fails closed even if the model errs. Run it the same way: put your own deterministic refusal layer in front, and keep a human sign-off on every SAFETY route.

Results

Blind figures are MEASURED by an independent scoring lane on held-out sets the training lane never saw, using the 4-bit adapter on an NVIDIA L40S. Development figures are PROVISIONAL: the training lane’s own reads.

Run 5, blind holdout Fail-closed held Exact route Exact risk tier
v2 (108 cases, 48 fail-closed), model alone 48⁄48 89⁄108 (82.41%) 97⁄108 (89.81%)
v2, rules v1.2 + model 48⁄48 87⁄108 (80.56%) 95⁄108 (87.96%)
v3 (108 cases, 60 fail-closed, advisory), model alone 58⁄60 100⁄108 (92.59%) 103⁄108 (95.37%)
v3, rules v1.2 + model 59⁄60 96⁄108 (88.89%) 100⁄108 (92.59%)

Across all configurations: zero missing predictions, zero contract failures (every output parsed), zero offline-egress violations.

Gates. G1 (fail-closed 100% on blind v2) held 48⁄48 for every configuration. G2 (risk tier at least 90% on blind v2) was missed by one case for the model alone and by three for the rules stack; THOX’s CTO waived the shortfall on 2026-12-01. Advisory set v3 records one fail-closed leak behind the rules and two for the model alone; they are open defects.

Development progression

Development set (PROVISIONAL unless noted) Stock (MEASURED) Run 4 Run 5
Golden route accuracy (216) 55.09% 92.13% 91.67%
Golden risk tier (216) 90.74% 96.30%
Holdout v1 risk tier (108) 85.19% 90.74%
Golden fail-closed, rules + model (86) 86⁄86 86⁄86
Golden fail-closed, model alone (86) 59⁄86 86⁄86 85⁄86

This Q4_K_M build. llama.cpp on a 24 GB NVIDIA L4, development golden set (PROVISIONAL, training lane): 216⁄216 parsed, fail-closed 86⁄86, risk tier 96.76%, route 91.67%, agreement with the adapter 207⁄216 routes and 208⁄216 risk tiers, p50 3.1 s and p95 3.4 s per decision, 17.9 GB GPU memory. On Ollama 0.40.19 (Apple silicon, 2026-12-01) it loaded and routed the two fail-closed test prompts to refuse_to_human (MEASURED, three prompts); full Ollama scores are not yet measured. Not measured on a ThoxUltra device.

Training data

1,883 rows, all authored-synthetic or verified teacher output. No customer data, no field photographs, no real credentials (fake canary secrets only).

Run Rows What changed
1 414 Vision seed v1 + 300 verified teacher rows
2 1,011 + gauge vision seed, incident and report contrast set
3 1,708 + photo-style vision seed, HSE procedure contrast set
4 1,783 + safety training-content contrast set
5 1,883 + 15 teacher risk-tier relabels, 100-row inspection contrast set

QLoRA (NF4), LoRA r16 / alpha 32 on all language-model linears plus the projector, vision tower frozen. 2 epochs, effective batch 16, one NVIDIA L40S, about 2 h per run.

Where it runs: ThoxUltra

ThoxQwen-Field is part of the software planned for ThoxUltra, THOX’s offline device line for oil and gas operators and oilfield service companies, on ThoxOS, with MeshStack sharing work among authorized devices at a site.

Tier Plan Model fit
ThoxUltra Compact field node, Arduino VENTUNO Q, 16 GB Small on-device models and the ThoxRoute rules; escalates to the apex tier
ThoxUltra Pro NVIDIA Jetson AGX Orin 64 GB developer kit Concurrency and model fit to be measured
ThoxUltra Pro+ NVIDIA Jetson AGX Thor T5000 developer kit Target tier for ThoxQwen-Field

At 27B parameters ThoxQwen-Field is an apex and host model. It does not fit the 16 GB ThoxUltra. ThoxUltra is a concept preview: nothing is built, rated or certified yet, and it carries no hazardous-area, ingress or environmental rating.

Limitations

  • G2 passed by waiver: on blind v2 the rules stack scores 87.96% and the model alone 89.81% exact risk tier, under the 90% bar.
  • Route accuracy on blind v2 is about 81% to 82%; treat routes as advisory to your own policy layer.
  • One known fail-closed leak on blind advisory set v3 behind the rules, two for the model alone.
  • Ollama serves text only; vision needs the llama.cpp build.
  • Vision training data is authored-synthetic, not field photographs.
  • Not for autonomous safety decisions, equipment operation, permit issuance or SCADA commands.
  • Base-model capability claims are the Qwen team’s, not THOX results.

Links