Operation Query LLM

The LLM proxy that speaks OQL.

oqllm gives your tools one local endpoint for every model your subllm policy allows. On top of that it runs an OQL lane: describe a hardware test in plain words and get back a VERSION: 6 scenario that has already passed the oqlos-core parser. It writes proposals. It never runs your rig.

Test protocol: one request, one repair

POST /v1/oql/generate

Intent what the engineer typed

Leak test for a PSS 7000 mask. After 60 seconds the pressure must stay at or below −9 mbar.

Declared devices and sensors

  • PUMP
  • valve-bo06
  • PI1

Options (defaults)

max_repairs: 2
timeout_seconds: 180

Request headers

X-Ticket: ticket-7

Attempt 1 model reply

VERSION: 6SCENARIO: Leak testGOAL:  SET NAME 'Leak'  SET WAIT '60 s'
Rejected: 3 errors
  1. L3GOAL w VERSION: 6 jest składnią legacy; użyj TASK: albo TEST_STEP:GOAL is legacy syntax in v6. Use TASK: or TEST_STEP:.
  2. L4SET NAME w VERSION: 6 jest składnią legacy; użyj NAME 'Leak'Use NAME 'Leak'.
  3. L5SET WAIT w VERSION: 6 jest składnią legacy; użyj TIMER '60 s'Use TIMER '60 s'.

oqllm sends these lines back to the model as a repair request.

Attempt 2 after one repair

VERSION: 6SCENARIO: Mask leak test PSS 7000DEVICE_TYPE: BA TASK:  NAME 'Prepare the rig'  PROMPT 'Fit the mask on the test head'  SET 'PUMP' 'off'  SET 'valve-bo06' '1' TEST_STEP:  NAME 'Leak after 60 s'  TIMER '60 s'  MAX 'PI1' '-9.0 mbar'  VAL 'PI1' 'mbar'  PASS 'PI1' 'Held at or below -9.0 mbar'  FAIL 'PI1' 'Rose above -9.0 mbar' TASK:  NAME 'Shut down'  SET 'PUMP' 'off'  SET 'valve-bo06' '0'
Valid: 0 errors, 0 warnings
Repairs
1 of 2 allowed
Model calls
2
Executed
no
Next step
oqlctl --mode dry-run
Parser messages are real oqlos-core output, shown as the parser writes them (Polish) with an English gloss. The two model replies are scripted for this demo.

Where it sits on the line

Your tools talk to oqllm as if it were OpenAI or Ollama. Ordinary chat goes straight through to subllm, which picks the provider, fails over in sequence and cools down a slow one. Requests for OQL take the side lane through the parser and come back as a proposal you review and dry-run yourself.

oqllm in the request path Clients connect to oqllm. Chat requests pass to subllm, which routes to Z.AI, OpenRouter, OpenAI Codex, Anthropic, Gemini or local Ollama. OQL requests also pass through the oqlos-core parser, are repaired up to three times, and leave as a proposal that a person dry-runs with oqlctl on the OqlOS host. IDE assistants Continue, Aider, Cursor Agents koru, heyasa, your own oqlctl and scripts curl, CI jobs oqllm port 11437 subllm routing and failover Z.AI OpenRouter OpenAI Codex Anthropic Gemini Ollama, local oqlos-core parser OQL v6 + generation policy errors back to the model, up to 3 repairs Proposal .oql, executed: false oqlctl dry-run by a person, on the OqlOS host The line stops at the proposal. oqllm has no hardware client and no execute endpoint.

Datasheet

Version 0.1.0. Routing and client compatibility come from subllm; everything else is oqllm's own code and tests.

Runs OQL on hardwareNo. It returns proposals. Execution stays with the OqlOS runtime and the person who starts it.
GrammarThe oqlos-core parser, the same code OqlOS runs. OQL versions 3 to 6 are read; generated scenarios must declare VERSION: 6.
Generation policyA generated scenario needs at least one TASK: or TEST_STEP:. IF, ELSE, CHECK, CORRECT and ERROR are rejected there. Names outside your declared device list are flagged.
Repair loop0 to 3 repairs, 2 by default. Each repair sends the parser's errors back to the model, inside one time budget.
Model routingsubllm routes oqlos-oqllm/oql-generate and oqlos-oqllm/oql-explain. Failover is sequential: no parallel speculative calls.
Client compatibilityOpenAI /v1/chat/completions and /v1/models, including streaming. Ollama /api/chat, /api/generate and /api/tags.
Models it addsoql writes a checked scenario. oql-explain walks through one in English, Polish or German.
Network bindLoopback only: 127.0.0.1, localhost, ::1. Requests with another Host header get 421.
Operation journalJSON lines with kind, status, provider, model, repairs and error counts. Prompts and scenarios are stored only as SHA-256 digests. File mode 0600.
Default port11437, next to subllm's 11435
RuntimePython 3.11 or newer. Apache-2.0.

Quickstart

Five steps from install to a scenario you can dry-run.

  1. Install oqllm. It brings subllm and the oqlos-core parser from pinned commits.

    pip install "oqllm @ git+https://github.com/oqlos/oqllm.git"
  2. Give subllm at least one provider key. oqllm keeps no keys of its own.

    export ZAI_API_KEY=…   # or OPENROUTER_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY
  3. Check the parser, the routes and which providers have credentials.

    oqllm doctor
  4. Start the proxy and point your tools at it.

    oqllm serve
    oqllm 0.1.0 listening on http://127.0.0.1:11437  (OQL lane: /v1/oql/*)
    
    export OPENAI_API_BASE=http://127.0.0.1:11437/v1   # model "oql" for scenarios, any other model passes through
    export OLLAMA_HOST=http://127.0.0.1:11437
  5. Write a scenario, check it, then dry-run it on the OqlOS host with a mocked sensor.

    oqllm generate "Leak test for a PSS 7000 mask: after 60 s, PI1 stays at or below -9 mbar" \
      --device PUMP,valve-bo06,PI1 -o leak.oql
    oqllm validate leak.oql --strict
    oqlctl leak.oql --mode dry-run -s PI1=-10.2

API

The OQL lane lives under /v1/oql/. Everything else is subllm's proxy, unchanged.

GET/healthStatus of oqllm, subllm, the parser and route registration
GET/v1/oql/schemaOQL v6 reference for clients and agents
POST/v1/oql/validateParser check, no model call
POST/v1/oql/generateIntent to a checked OQL v6 proposal
POST/v1/oql/explainScenario to a plain-language walkthrough
GET/v1/oql/operationsRecent operations, metadata only
POST/v1/chat/completionsoql and oql-explain here; other models pass to subllm
GET/v1/modelsThe two OQL models plus your subllm catalog
POST/api/chatOllama-compatible chat, served by subllm
curl -s http://127.0.0.1:11437/v1/oql/generate \
  -H 'Content-Type: application/json' \
  -H 'X-Ticket: ticket-7' \
  -d '{"prompt": "Leak test for a PSS 7000 mask",
       "devices": ["PUMP", "valve-bo06", "PI1"],
       "max_repairs": 2}'
{
  "object": "oql.proposal",
  "status": "valid",
  "executed": false,
  "repairs": 1,
  "route": "oqlos-oqllm/oql-generate",
  "provider": "zai",
  "model": "glm-5.3",
  "validation": {"valid": true, "errors": [], …},
  "source": "VERSION: 6\nSCENARIO: Mask leak test…"
}

Part of oqlos

oqllm is the language-model piece of the oqlos toolchain for quality and compliance testing on lab and production rigs.

  • oqlos

    The OQL runtime: parser, interpreter, hardware layer and oqlctl.

  • oql-scenario

    The canonical store of .oql scenarios and its HTTP API.

  • subllm

    Provider, model and route policy with sequential failover.

  • oqllm

    This proxy. Apache-2.0, issues and pull requests welcome.