Chat models: silent auto-RAG via legacy FC (no knowledge tool, no narration)
This commit is contained in:
1 parent
92e7ddec05
commit
e56d0456bb
1 file changed
+27
-20
+27
-20
@@ -2024,31 +2024,38 @@ async def list_models(request: Request):
|
|||||||
if kb_entry not in model["info"]["meta"]["knowledge"]:
|
if kb_entry not in model["info"]["meta"]["knowledge"]:
|
||||||
model["info"]["meta"]["knowledge"].append(kb_entry)
|
model["info"]["meta"]["knowledge"].append(kb_entry)
|
||||||
|
|
||||||
# Steering: with knowledge attached, the model gets a
|
# SILENT AUTO-RAG (legacy function-calling mode), chosen 2026-10-09:
|
||||||
# query_knowledge_files tool and tends to call it on every
|
# with native FC the model gets a query_knowledge_files tool and
|
||||||
# prompt — including questions unrelated to the co-op — which
|
# calls it on every prompt — including off-topic ones — with
|
||||||
# adds an embedding call + vector search (latency) before
|
# visible "let me check the docs" narration. Prompt steering
|
||||||
# answering. A soft hint proved insufficient (member test
|
# failed twice (soft + firm). Legacy mode instead auto-injects
|
||||||
# 2026-10-09: off-topic question still queried the docs), so
|
# relevant docs chunks into context on every message: silent,
|
||||||
# this is a firm rule with explicit negative instruction.
|
# no tool-calls, no announcements, grounding always on. Cost:
|
||||||
# params.system is merged ahead of any system content by Open
|
# one embedding + vector search per message (~300ms, paid even
|
||||||
# WebUI's middleware.
|
# on off-topic messages). builtinTools.knowledge=false removes
|
||||||
|
# the knowledge tool + <attached_knowledge> tag so the model
|
||||||
|
# can't narrate or fumble; the injected sources still ground
|
||||||
|
# co-op answers.
|
||||||
model.setdefault("params", {})
|
model.setdefault("params", {})
|
||||||
|
model["params"]["function_calling"] = "legacy"
|
||||||
|
model["info"]["meta"]["builtinTools"] = {"knowledge": False}
|
||||||
|
|
||||||
|
# Steering: sources arrive as plain context. Tell the model the
|
||||||
|
# docs may be present but are co-op-only, so it never cites or
|
||||||
|
# mentions them for off-topic answers.
|
||||||
steering = (
|
steering = (
|
||||||
"About the attached knowledge base: it contains ONLY the "
|
"Some messages include excerpts from the Inference "
|
||||||
"Inference Cooperative's own documentation (membership, "
|
"Cooperative's own documentation (membership, models, API, "
|
||||||
"models, API access, governance). It is NOT general "
|
"governance), added automatically as background context. "
|
||||||
"knowledge. Do NOT search or query it unless the user "
|
"Use those excerpts only when they are relevant to the "
|
||||||
"explicitly asks about the Inference Cooperative, its "
|
"user's actual question. For general questions, ignore them "
|
||||||
"services, its models, its pricing, or its governance. For "
|
"and answer from your own knowledge — do not mention the "
|
||||||
"ANY other topic — general knowledge, how-tos, opinions, "
|
"co-op, its documentation, or any knowledge search unless "
|
||||||
"world facts — answer directly from your own knowledge "
|
"the user explicitly asks about the co-op."
|
||||||
"without touching the knowledge base. When in doubt, do "
|
|
||||||
"not query it."
|
|
||||||
)
|
)
|
||||||
existing = model["params"].get("system")
|
existing = model["params"].get("system")
|
||||||
if existing:
|
if existing:
|
||||||
if "Inference Cooperative's" not in existing:
|
if "Inference Cooperative" not in existing:
|
||||||
model["params"]["system"] = existing + "\n\n" + steering
|
model["params"]["system"] = existing + "\n\n" + steering
|
||||||
else:
|
else:
|
||||||
model["params"]["system"] = steering
|
model["params"]["system"] = steering
|
||||||
|
|||||||
Reference in new issue
Block a user