Skip to main content

Module prepared

Module prepared 

Source
Expand description

The shared prepared semantic request (Prompt Precision route carry).

One profile document — the same JSON shape the POET HTTP API accepts under conditioning — is persisted at {storage}/conditioning/active-profile.json and compiled per turn by the core compiler (poet_llm_conditioning::prepare_conditioned_prompt). Every product route then lowers the same plan:

  • native / orchestrated chat: the rendered envelope is prepended to the augmented prompt before decode;
  • Ollama: the envelope travels in the native system role field, with the output budget carried as num_predict;
  • remote MCP: lower_mcp_tool_arguments produces structured or flattened tool arguments with an explicit role-degradation receipt.

“Same request” means same logical plan and traceability — wire syntax differs per backend capability and receipts say so honestly.

Structs§

PreparedRouteReceipt
Per-route lowering receipt attached to inference results. route is "native", "orchestrated", "ollama", "remote_mcp" or "http"; role_mode records how the request reached the backend: "envelope" (merged into the prompt text), "system" (dedicated role field), "structured" (separate MCP arguments) or "flattened" (single argument).
PreparedSemanticRequest
One compiled semantic request — route-neutral plan receipt plus the rendered request text the compiler produced for it.

Constants§

ACTIVE_PROFILE_DIR
ACTIVE_PROFILE_FILENAME

Functions§

activate_profile
Validate a profile by compiling it once against an empty context, then persist it as the active profile shared by all inference routes. Returns the probe plan receipt.
active_profile_path
Active profile path.
active_profile_status
Current activation state for status surfaces.
deactivate_profile
Clear the active profile. Returns whether a profile was present.
load_active_profile
The persisted active profile document, if present and well-formed JSON.
prepare_active_semantic_request
Compile the persisted active profile for this turn. Ok(None) when no profile is active — routes keep their legacy shape.
prepare_semantic_request
Compile one profile document against one request. Never silently rewrites: failures mean the declared profile cannot run, so callers fail closed instead of dropping enforced requirements.