Skip to main content

Bring your own LLM with modulator packs

By default /v1/respond generates the reply for you. With return_format: "modulator_pack" uniqOS runs everything except generation — memory recall, emotional inference, pre-generation guardrails, prompt assembly — and hands you the pack so you can call your own model:

{
"return_format": "modulator_pack",
"modulator_pack": {
"system_prompt": "…fully assembled, guardrail-aware…",
"user_message_processed": "…",
"context_to_inject": {
"personality_summary": "…",
"user_model_summary": "…",
"relational_memory_summary": "…",
"current_emotional_state": { "primary": "frustration", "intensity": "moderate" }
},
"post_generation_instructions": "…what the delegated guardrails expect…"
}
}

Three things to know:

  1. Pre-generation guardrails still run server-side and are baked into the system_prompt. Post-generation guardrails can't run (there's no response yet) — they are described in post_generation_instructions and listed in guardrails.delegated_to_client; applying them is your responsibility.
  2. Billing is identical to text mode: one turn. The only difference is usage.llm_provider: null.
  3. Streaming is incompatible with modulator packs (422).

Stateful memory keeps working: the turn still updates the user model, so your own-LLM responses benefit from the same relational memory on the next call.