Tuna Kömürcü
← Key Projects
NLP & Fine-tuningMLOps & Cloud

SkyMind

A research prototype that fine-tunes a small LLM to translate Turkish operator commands into a schema-checked mission plan. When the command is missing information, ambiguous, or out of scope ("fire at the target"), it asks a clarifying question or refuses rather than inventing a plan. Open-source models and synthetic data only; no claim of a real operational system.

Problem

A language model asked to plan a drone mission will happily fill in missing coordinates or speeds with plausible-looking values. The hard part isn't producing JSON — it's knowing when not to, and proving the difference with measurements instead of demos.

Flow

An offline training line that produces the model, and an online serving path where every output is checked against the same schema used during training and evaluation.

Offline training line and online serving path
  1. 01Synthetic data — a template/grammar engine plus LLM paraphrasing generates Turkish commands, with a leakage-free split and a 300-example gold set that was verified by hand.
  2. 02Fine-tuning — Qwen2.5-1.5B is trained with QLoRA (SFT), then aligned with DPO specifically to reduce invented plans and unnecessary questions.
  3. 03Quantization — the SFT model is exported to GGUF at five precision levels and benchmarked for size, accuracy, and latency.
  4. 04Serving — a C++ service built on llama.cpp exposes the model over HTTP and validates every response against the schema server-side, with Prometheus metrics.
  5. 05A/B gateway — a FastAPI gateway assigns each request to the SFT or DPO model by SHA-256 hash and compares them with a z-test, with MLflow for experiment tracking and Grafana for dashboards.
  6. 06Side modules — a BM25 + embedding + RRF hybrid RAG with sentence-level citations and a 'no answer' behaviour, and a METAR/NOTAM parser whose Turkish summaries are checked for numeric fidelity.

Technologies

Python + C++17PyTorch, Transformers, PEFT, TRLQwen2.5-1.5B (QLoRA, DPO)BERTurkllama.cpp / GGUFONNX RuntimePydanticFastAPIMLflowPrometheus + GrafanaPodman + Kubernetes manifestsGitHub Actions

Notable decisions

The schema is the single source of truth

Training targets, evaluation, and the C++ server all validate against the same rules. Output that fails the schema or carries an out-of-range value counts as invalid, so "valid JSON" can't be mistaken for "correct plan" — and the repo says so explicitly, including a demo run where 2 of 5 commands failed validation.

Clarify and refuse as first-class outputs

The model has three legitimate answers — plan, clarification question, refusal — and is trained and scored on choosing the right one. DPO halved unnecessary questions on the gold subset (13.1% to 6.8%) but slightly lowered schema validity, a trade-off reported rather than hidden.

Quantization measured, not assumed

Q5_K_M matched F16 accuracy (0.843 vs 0.842) at about a third of the size and roughly half the latency; Q4 dropped to 0.758 and Q3 collapsed to 0.180. The right level was picked from the table, not from a default.

Honest about what the speed-up is

The C++ service is about 4.8x faster at p50 than the Python HF bf16 service, but running the same GGUF through the same llama.cpp binaries makes Python only 6–7% slower. Most of the gap comes from the stack, not the language.

Result

On 400 held-out synthetic examples, DPO reached 0.848 field accuracy and a 1.1% invented-plan rate (SFT: 0.842 and 1.6%; zero-shot: 0.014 and 4.3%). Intent classification with BERTurk scores 0.986 accuracy. All results are in-distribution on synthetic data, from a single training seed, and are not real-world performance. The Kubernetes manifests were never applied to a cluster; the Podman compose stack was run. Built with Claude Code, with the gold set (300/300) reviewed by me.

View repository