Architecture · LikeC4

NLS Fine-tune (SciX)

Translates natural language to ADS search queries (hybrid pipeline + fine-tuned model) and the data/training/eval machinery behind it

built evolving planned research risk

The whole picture

System landscape

The system in context, then opened up into its containers.

NLS Fine-tune (SciX) — system landscape

NLS Fine-tune (SciX) — system landscape

index
NLS Fine-tune — containers (built vs planned)

NLS Fine-tune — containers (built vs planned)

nlsSystem

Translates natural language to ADS search queries (hybrid pipeline + fine-tuned model) and the data/training/eval machinery behind it

Risks & open questions

Risks & open questions

risks
Planned & research work

Planned & research work

planned

Inside each box

Containers & components

Each part decomposed into the components that implement it. Every box links to its source in the interactive explorer.

NLS inference server — routing & runtime

NLS inference server — routing & runtime

serverContainer

docker/server.py — OpenAI-compatible /v1/chat/completions consumed by nectar; routes pipeline-first, model-fallback

Hybrid NER pipeline — components

Hybrid NER pipeline — components

pipelineContainer

domains/scix — deterministic NER → few-shot retrieval → template assembly → constraint; guaranteed-valid ADS syntax in ~5ms

Dataset generation agent — 10-stage pipeline

Dataset generation agent — 10-stage pipeline

dataPrepContainer

dataset_agent — a resumable 10-stage pipeline that turns vocabulary sources + templates into validated NL→query training pairs

Evaluation harness — benchmark & semantic-overlap

Evaluation harness — benchmark & semantic-overlap

evalContainer

Two harnesses: benchmark (exact-match / field / operator / syntax) and semantic-overlap (ADS result-set Jaccard / P@N / R@N)

Review API — services & routers

Review API — services & routers

apiContainer

FastAPI backend for the playground / dataset browser / evaluation viewer. RISK: prompts and labels still say "Sourcegraph" in places — leftover from the pre-ADS origin and not fully re-skinned for ADS

How it runs

Walkthrough flows

Dynamic views — the narrative spine of the system, step by step.

Walkthrough — translate a query at runtime

Walkthrough — translate a query at runtime

translateFlow

Nectar calls the OpenAI-compatible endpoint. The pipeline runs first (~5ms, guaranteed-valid syntax); the model is reached only when pipeline confidence falls below PIPELINE_CONFIDENCE_THRESHOLD. Routing is logged for the flywheel.

Walkthrough — build the training dataset

Walkthrough — build the training dataset

buildDataset

Three sources merge into the training set: synthetic pairs from vocabulary catalogs, real query-log pairs with Claude-generated NL, and the hand-curated gold seed. Every candidate passes local-syntax and ADS-API validation before the 90/10 split.

Walkthrough — fine-tune & publish the model

Walkthrough — fine-tune & publish the model

trainFlow

Training runs off-machine on Colab. The train split is uploaded, a LoRA adapter is fit on Qwen3-1.7B (~90 min on A100), and the adapter is pushed to HuggingFace where the inference server loads it on first start.

Walkthrough — evaluate translation quality

Walkthrough — evaluate translation quality

evalFlow

Two lenses. Benchmark scores exact-match / field / operator / syntax offline. Semantic-overlap runs each query against the live ADS API and compares result-set bibcodes (Jaccard / P@N / R@N) — the PRD target metric. Curators read the runs in the UI.

Where it runs

Deployment

What runs where, and the process & data boundaries between the pieces.

Deployment — where each piece runs

Deployment — where each piece runs

deployment

Explore it live

The figures above are static exports. The interactive explorer lets you pan, zoom, follow relationships, and jump from any box to the source.