Subashanan Nair
All case studies
Published

Penang AI Assistant

Can a language model answer questions about Penang's economy safely, using only official statistics?

The answer

Across 45 evaluation cases run 3 times each, gpt-oss:120b passed all 6 release gates: every supported question matched the reference answer, every displayed number matched its returned evidence, and every ambiguous, unsupported or adversarial case was handled without fabricated facts.

Key numbers

81/81

supported questions answered with the correct result, across 3 repeats.

100% supported-query correctness; threshold 90%; dev 60/60 and held-out 21/21.

87/87

released answers whose displayed numbers matched their returned evidence.

100% displayed numerical consistency; threshold 100%.

1.55 s

median latency per successful answer, p95 2.43 s.

Includes the network round trip to Ollama Cloud; 0 timeouts and 0 infrastructure failures in 135 runs.

The evidence

The analysis is in progress

When the first run is published, this chapter will show an evaluation of answer accuracy against hand-checked questions, and how often the assistant correctly refuses questions the data cannot answer.

Nothing here is estimated or illustrative. Results appear only after the pipeline publishes them with their sources.

How it was made

Data sources

SourcePublisherWhat we usedLicenceRetrieved
OpenDOSMDepartment of Statistics MalaysiaCPI, CPI inflation and quarterly unemployment by stateCC BY 4.02026-10-12
Ollama CloudOllamagpt-oss:120b to plan each answer and its SQLProvider terms2026-10-12

Method

  1. Fetch CPI, CPI inflation and quarterly unemployment from the OpenDOSM API.
  2. Validate each file against a column contract, quarantining bad rows with their reasons.
  3. Load accepted data as a new snapshot, keeping the last good snapshot if a refresh fails.
  4. Have the model turn each question into SQL, then check it against a policy and run it read-only on approved views.
  5. Record every question, query and result in an insert-only audit log.

Limitations

  • A personal prototype, not an official service.
  • Covers only CPI, inflation and unemployment so far.
  • Answers depend on a single model provider; a second provider is planned.
  • Answer accuracy was measured on 45 hand-checked cases run 3 times each under the committed evaluation report 20261012T122949_gpt-oss-120b_plan-v6_all.json, and all six release gates passed. Held-out figures have wide uncertainty because the set is small.

Check it yourself

Reproduce

uv sync
docker compose up -d --wait
uv run python -m ingestion.cli refresh
uv run uvicorn api.main:app --port 8010
Commit
09c0b81 (dirty build)
Manifest
evaluation/reports/20261012T122949_gpt-oss-120b_plan-v6_all.json
Python
3.11
Last run
2026-10-12

The code repository is private for now.

Discuss

Have a question you think it should answer, or one it should refuse? Suggestions are welcome.

Discuss this study on GitHub