Replace references and defaults for the JD-parse / T1 reasoning polish from Qwen3.5-2B to Qwen3-1.7B across docs, config, Dockerfile and code. Make T1 LLM polish conditional on reasoning.mode == "llm" (default "template" keeps full NLG, no LLM). Update model repo/gguf names, README benchmarking notes, prefetch logging, and explanatory comments to reflect the new preferred model and behavior.
Add JD to image; logging banners; safe explain
Hemprasad Badgujar
d40bd07
Ensure job_description.md is included in the build context and copied into the image (prevents empty JD causing meaningless rankings). Tighten .dockerignore to allow select problem files only. Add _phase_banner and bracketed PHASE START/END/FAILED markers to step() (respects RERANKER_LOG). Refactor add_explanation into _add_explanation_inner and wrap it with a top-level try/except so unexpected errors are logged with traceback and a safe per-row fallback reasoning is returned (pipeline never crashes).
Add LLM call timeout and streaming pipeline phases
Hemprasad Badgujar
26f86bb
Implement hard per-call timeout (45s) via threading to prevent runaway LLM generations that were observed taking 1996s with no way to interrupt. Convert pipeline phases to generators to yield results as they complete instead of batching at the end, enabling live status updates on slow hardware. Add per-call timing metrics to JD parse artifact. Introduce post-hoc reasoning audit to catch empty/duplicate/leaked-name issues for hackathon grading. Update polish acceptance gate with sentence-count bounds (2-4) and contradiction markers to ensure top-10 notes read as strengths-only.
Add observability logging for LLM and embedder
Hemprasad Badgujar
fbbd1c5
Log LLM generation start/completion events at info level with timing and character metrics. Add warning logging when PotionPicker initialization fails, improving observability for model availability and performance monitoring.
Add timing and error logging throughout
Hemprasad Badgujar
f1347ae
Instrument critical paths with performance metrics and error tracking. Add time.perf_counter() timing to model loading (_load_llama, _load_potion, load_onnx_session) and LLM generation. Wrap key operations in try-except blocks to log failures with context. Track progress of explanation polish with per-row and per-batch timing. Improves observability for debugging performance issues and troubleshooting failures in production.
Add CPU threading, T1-only LLM polish, experiment script
Hemprasad Badgujar
a41b023
Introduce process-level CPU thread budgeting and cgroup-aware resolution (config.compute.cpu_threads, resolve_cpu_threads, configure_compute, onnx_session_options). Wire cpu_threads through ONNX loaders and retrievers. Switch Step-11 LLM polish to T1-only (top 10) and update tiers/acceptance logic; add batched prompt handling and stability fixes. Add scripts/explain_prompt_experiment.py for fast prompt iteration. Improve settings loading so RERANKER_* env vars override YAML (Yaml-backed source). Minor UX/CI touches: CLI/Streamlit call order, hashing fixes in preprocess, model prefetch updates, README updates, and new runtime tests.
Remove char limits; expand template variants
Hemprasad Badgujar
c408892
Removed arbitrary character ceilings that silently discarded well-formed explanations without improving output quality. Instead:
- Relaxed reasoning char limit in compose.py (removed 500 char trim)
- Separated summary and experience truncation in engine.py (independent 500/900 budgets) so verbose summaries no longer starve role descriptions
- Removed upper bound in tiers.py polish() check (kept 120 char floor)
- Expanded all template banks from ~6 to 9 variants each for better phrasing diversity
- Expanded BEHAVIOR_TAGS from 3-4 to 5 variants per slot
Length constraints are now enforced at generation time (max_tokens) and validation (floor only), allowing grounded, well-structured prose through.
Reuse Qwen3.5 for T2; drop LFM2.5 & factor ONNX
Hemprasad Badgujar
190f0fc
Remove the LFM2.5/T2 polish and related SmolLM2 fallback; T1 and T2 now reuse the Qwen3.5-2B JD-parse model. Update configs, comments and README to reflect the smaller prefetch set and adjusted baked size (~2.3 GB). Factor ONNX session loading into a new src/retrieve/onnx.py and update granite/reranker to use it. Remove orjson-backed JSON/text atomic writers and their exports, simplify models/llm API (drop polish-related helpers), and clean up imports/logging. Add presentation (docs/Redrob_Submission_SoloLeveling.pptx) and various doc/UI text updates to match the new model policy.
Explain: randomize the over-used 'Built' opener across build-synonyms
Hemprasad Badgujar
6120fbd
The LLM opens most outcome notes with 'Built ...'. Swap that single
over-used opener for a random TRUE synonym (Developed, Engineered,
Created, Delivered, Implemented, Architected, Constructed, Established,
Designed and built, Rolled out, Stood up, Produced, Set up, Built out) so
openers vary without changing meaning. Verbs the model chose itself
(Shipped, Led, Designed, Scaled) are left untouched.
Safe: the swap runs after the grounding check, and the sentence-initial
verb is never grounding-checked. Verified on a full run: the opener verb
now spreads across ~6+ forms instead of 'Built' dominating; acceptance,
timing, and all other guards unchanged. 93 tests pass.
Reasoning now follows the candidate-ranking research: outcomes over
pedigree, per-requirement justification, beyond keywords, bias-free,
concise. Driven by a prompt-engineering sweep (A/B/C/D over cached
candidates): variant C (structured, verb-first, NO few-shot) won at
11/15 grounded vs 2/15 baseline; few-shot leaked its own facts and
crashed grounding to 0/15.
- Feed the candidate's OWN WORDS (summary + career descriptions) to the
LLM so it can surface a real achievement; grounding source widened to
cover that evidence.
- Winning prompt: S1 starts with a past-tense outcome verb, S2 ties to a
stated requirement, S3 covers seniority/availability + <=1 soft gap;
third person, no schools, no dashes, specific not generic.
- Deterministic "The candidate" strip -> verb-first openers; third-person
guard rejects verbatim first-person copies; smart-quote/dash normalize.
- T2 routed to Qwen3.5-2B (LFM2.5 verified useless: 3/15 verbatim copies)
and dropped from prefetch (-220 MB).
…
Explain: natural 'relevant to the requirement' tail, high variety
Hemprasad Badgujar
c5b9caf
The closing clause read mechanically ("with keyword matches on skills,
job titles and education") and felt templated (always "with...", always
ending "requirements").
- Reframe as natural recruiter English: the matched fields are RELEVANT
to the role's requirements, e.g. "skills, title and education map
cleanly to the brief" / "a close fit on skills and title".
- 18 varied tails with DIFFERENT openers (", with" / "; <clause>" / ", a
match on" / ", strong on") and DIFFERENT ending nouns (role / brief /
spec / posting / listing / needs / ask / requirements) so it never
reads as a fixed template.
- field label "job titles" -> "title"; update the LLM one-shot to match.
Verified over a full run: 81/100 distinct signal sentences, 100/100
distinct reasonings, 0 "with"-prefixed, ending nouns spread, max 497
chars, 0 dashes. 93 tests pass.
Explain: A+B sentence structure, behavioral framing, more variety
Hemprasad Badgujar
362838c
Reasoning rewrite per feedback — present strengths then behavior, no
template feel, no AI-looking em-dashes.
- Structure (A+B): S1 identity + fit verdict; S2 strengths (+<=1 soft gap
on T3/T4); S3 behavioral signals as a NARRATIVE (open to work, in
recruiter demand, active in open source) not a data dump; S4 why-ranked
(dominant signal + which JD fields matched lexically).
- Drop the rank ordinal ("top 10") — redundant with the rank column;
replace with concrete signal + BM25 field-hit detail.
- Variety so it doesn't read as a template: varied openers, connectives
(and / as well as), gap pivots (though / albeit / the main gap being),
and 5 behavior-sentence forms. Result: 100/100 distinct reasonings.
- No em-dashes anywhere (commas/periods/colons only).
- Grammar fixes: a/an before vowels, no doubled connectives, no
"...is that <noun phrase>", no doubled seniority ("Lead Staff").
- Length guard: trims keyword tail then strengths so every line <500.
- Location promoted in…
Explain: revert LLM polish that collapses to <3 sentences
Hemprasad Badgujar
f4b411e
LFM2.5 (T2) occasionally compresses 3-4 sentences into one comma-spliced
run-on; the length guard passed it but it read as a single sentence. Add
a sentence-count floor (>=3) to the polish acceptance — any shorter
reverts to the deterministic NLG (always 3-4 clean sentences).
Verified over a full run: sentence count min=3 max=4 mean=4.0, 0 rows
under 3 sentences, tier gap-gating intact (T1/T2=0, T3/T4 only).