# MargIQ Full Context MargIQ stands for workflow-aware intelligence in AI operations. AI systems should not treat every request as equal. A simple support classification, a routine billing summary, an agent tool call, and a security incident may all enter the same product through the same API, but they should not always use the same model, cost profile, latency profile, or risk posture. MargIQ observes AI traffic, learns workflow patterns, and creates governed routing paths from the customer's available models. A routing path answers: 1. What kind of request is this? 2. Which available model is safe enough for it? 3. When should MargIQ avoid optimizing? 4. How much impact did this decision create? ## Positioning MargIQ is workflow intelligence for choosing the right model from your available models. Alternative phrasing: - MargIQ helps AI teams reduce model spend without blindly sacrificing quality. - MargIQ learns AI workflows and chooses cheaper or faster available models only where they are safe. - MargIQ turns model optimization into governed routing paths, not one-off heuristics. - MargIQ is the control plane for model choice. ## What MargIQ Does MargIQ watches production AI traffic, learns recurring request shapes, and shows workflow-level evidence in the dashboard. When teams upgrade to Pro and enable Automatic mode, MargIQ can apply earned routing paths from the models the application has made available. Example: ```text Workflow: Support ticket classification Routing path: Routine password reset triage Requested model: GPT-4o Optimized model: GPT-4.1 Nano Reason: Short, low-risk classification with strict JSON output. Routing path: Security or privacy incident Requested model: GPT-4o Optimized model: GPT-4o Reason: High-risk support cases stay on the requested model. ``` ## Core Beliefs ### Workflows Matter More Than Individual Prompts Customers care about support triage, invoice extraction, customer chat, moderation, policy summarization, sales qualification, and internal operations. They do not want to interpret prompt hashes or rule IDs. ### Optimization Must Be Earned An optimization is valid only when MargIQ has enough evidence that a cheaper or faster model is safe for a specific routing path. If the request is uncertain, risky, unusual, or outside the learned boundary, MargIQ keeps the requested model. ### Safety Is Part Of The Value The strongest MargIQ story is not only savings. It is savings on routine work while intentionally protecting high-risk work. ### Customers Need Control The UI should expose workflow name, mode, status, routing paths, optimized model, safety guards, savings, and recent decisions. It should not expose workflow hashes, variant IDs, raw rules, embeddings, thresholds, or internal policy JSON. ## Plans ### Free - Default plan for every new organization. - Report-only mode. - No backend model routing policies are applied. - No per-workflow recommendations are shown as active controls. - Savings page shows estimated potential savings range. - Lightweight heuristic optimization can be shown as free value. ### Pro - Full workflow intelligence. - Backend recommendation policies enabled. - Workflow-level model routing. - Analyzer-backed recommendations. - Policy learning and consolidation. - Per-workflow controls are available. - Savings and reporting show deeper breakdowns. ## Workflow Modes ### Automatic MargIQ applies earned routing paths. ### Report only MargIQ analyzes savings and workflow behavior without changing requests. ### Disabled MargIQ does not optimize or analyze the workflow. ## Developer Setup Recommended adoption path: 1. Install the SDK. 2. Create a MargIQ workspace and API key. 3. Keep the customer's existing provider credentials and base URL unchanged. 4. Add only the MargIQ-specific environment variable: MARGIQ_API_KEY. 5. Wrap the existing OpenAI-compatible provider client. 6. Pass provider and availableModels so MargIQ only recommends models from the customer's available model list. 7. Send a verification request. 8. Review dashboard evidence. 9. Enable Automatic mode only after workflow evidence is strong. MargIQ is platform agnostic. Provider keys such as OpenAI, OpenRouter, Anthropic, or custom OpenAI-compatible keys are customer/provider configuration, not MargIQ requirements. Official SDK package: https://www.npmjs.com/package/margiq Copy-paste prompt for coding assistants: ```text You are helping me add MargIQ to an existing AI application. Goal: - Keep the current OpenAI-compatible code path working. - Add MargIQ from a server-side module, never from browser code. - Add only the MargIQ-specific environment variable: MARGIQ_API_KEY. - Use MargIQ Cloud defaults; do not add custom MargIQ infrastructure settings unless the team explicitly has a private deployment. - Preserve the app's existing model-provider credentials and base URL configuration. - Wrap the existing OpenAI-compatible client with the MargIQ SDK. - Pass provider and availableModels to MargIQ so routing stays inside your available model list. - Keep the requested model in each call as the quality anchor. - Send one low-risk verification request and confirm a transaction appears in the MargIQ dashboard. Constraints: - Preserve existing request/response behavior. - Do not hardcode secrets. - Do not expose MARGIQ_API_KEY in frontend/browser bundles. - Do not manually call MargIQ recommendation or event endpoints from product code. - Do not expect MargIQ metadata on the LLM response object; evidence appears in dashboard transactions. - Keep the change minimal and easy to review. - Explain what changed after implementation. ``` ## Public Pages - Homepage: https://getmargiq.com/ - Product: https://getmargiq.com/product - Docs: https://getmargiq.com/docs - Quickstart: https://getmargiq.com/docs/quickstart - npm package: https://www.npmjs.com/package/margiq - LLM setup: https://getmargiq.com/docs/llm-setup - Examples: https://getmargiq.com/docs/examples - Use cases: https://getmargiq.com/use-cases - Proof: https://getmargiq.com/proof - Controlled benchmark: https://getmargiq.com/benchmarks/workflow-aware-llm-routing - Controlled benchmark data (JSON): https://getmargiq.com/benchmarks/workflow-aware-llm-routing.json - Controlled benchmark summary (Markdown): https://getmargiq.com/benchmarks/workflow-aware-llm-routing.md - Pricing: https://getmargiq.com/pricing ## Proof Language MargIQ evaluated 15 workflow families and 21 safety and generalization scenarios in a controlled sandbox suite. In the retained 58-request snapshot, two routes had complete transaction-level lower-cost evidence and one higher-risk route deliberately retained GPT-5. The strongest same-workflow result was 74.8% lower measured model cost for a routine GPT-5 order lookup routed to GPT-4.1 mini, while a safety-sensitive refund request in the same workflow stayed on GPT-5. A separate strict classification path measured 90.7% lower model cost. Always label these as controlled path-level benchmark results, not customer production results or guaranteed account-wide savings. Recommended wording: - Find the workflows where cheaper, faster models are safe. - Keep risky requests on stronger models. - Measure savings before enabling optimization. - Use measured percentages only for the documented benchmark paths. - Reduce model spend on eligible routine workflows. - Improve latency where simpler models are safe enough. - Preserve quality with workflow-level safety guards. ## Contact - Email: support@getmargiq.com