msradam commited on
Commit
745d7fb
·
verified ·
1 Parent(s): 1c134dd

fix(mellea): increase num_predict 350→512 to avoid citations_dense truncation

Browse files
Files changed (1) hide show
  1. app/mellea_validator.py +5 -6
app/mellea_validator.py CHANGED
@@ -357,15 +357,14 @@ def reconcile_strict_streaming(
357
  {"role": "system", "content": system_prompt},
358
  {"role": "user", "content": user_prompt},
359
  ]
360
- # num_predict 350 caps the 4-section briefing at ~300 tokens.
361
- # The vLLM deployment uses --max-model-len=2352; reconciler prompts
362
- # typically run 1800-2000 tokens after trim_docs_to_plan, leaving
363
- # ~350-500 tokens for output. 350 keeps total safely under 2352
364
- # even on a dense prompt. Override with RIPRAP_MELLEA_NUM_PREDICT.
365
  # num_ctx (Ollama only) is forwarded via extra_body; vLLM ignores it.
366
  base_opts = {"temperature": 0,
367
  "num_ctx": int(os.environ.get("RIPRAP_MELLEA_NUM_CTX", "4096")),
368
- "num_predict": int(os.environ.get("RIPRAP_MELLEA_NUM_PREDICT", "350")),
369
  **(ollama_options or {})}
370
 
371
  paragraph = ""
 
357
  {"role": "system", "content": system_prompt},
358
  {"role": "user", "content": user_prompt},
359
  ]
360
+ # num_predict 512 lets the 4-section briefing complete in one pass.
361
+ # Reconciler prompts run ~1200 tokens (after trim_docs_to_plan),
362
+ # so 1200+512=1712 comfortably under the vLLM max_model_len=2352.
363
+ # Override with RIPRAP_MELLEA_NUM_PREDICT if needed.
 
364
  # num_ctx (Ollama only) is forwarded via extra_body; vLLM ignores it.
365
  base_opts = {"temperature": 0,
366
  "num_ctx": int(os.environ.get("RIPRAP_MELLEA_NUM_CTX", "4096")),
367
+ "num_predict": int(os.environ.get("RIPRAP_MELLEA_NUM_PREDICT", "512")),
368
  **(ollama_options or {})}
369
 
370
  paragraph = ""