MuleHub
Docs
Browse/MuleSoft Projects/MuleSoft Omni Gateway - LLM Proxy with Semantic Routing

MuleSoft Omni Gateway - LLM Proxy with Semantic Routing

MuleSoft Projectsby Kevin Han MuleSoft
0.0 (0)
·3 downloads·Published 5/27/2026
Read Original ArticleDownload v1.0.0
Summary Powered by AIProject Template

Mule 4 LLM Gateway Template with Semantic Routing and Observability

Bootstraps a Mule application that intelligently routes prompts to the optimal LLM provider based on semantic classification, with built-in cost-optimization, prompt safety guardrails, and full observability. Ideal for developers who want a production-ready LLM routing gateway and a simple UI to test routing without implementing model selection logic from scratch.

What's Included

Intelligently routes prompts to the optimal LLM provider based on content semantics — with built-in cost optimization, prompt safety guardrails, and full observability. No model selection logic required from the developer.

Tags

mulesoftmulesoft-projectsvm-connectorjsonerror-handling
HTTP Listener flow with OpenAPI RAML specification and example endpoints
Prompt Routing Flow that orchestrates classifier, optimizer, and safety flows
Semantic Classifier DataWeave script for content-based provider selection
Cost Optimization Decision Module with pluggable pricing rules
Prompt Safety Guardrails Flow enforcing sanitization and reject rules
Provider Connector configurations for OpenAI, Anthropic, and Local LLMs
Fallback Provider Connector and retry/distribution policies
Observability stack: logging configuration, metrics exporter (Micrometer/Prometheus) and audit trail flow
React-based UI test client pre-wired to the gateway for quick validation
docker-compose and Dockerfile for local runtime and README quickstart

How It Works

1

Get Started

Clone or download the project, then import the Mule application into Anypoint Studio or extract and open in a code editor. Review the README for a quick file map and prerequisites such as Mule runtime version and Docker.

2

Configure Secrets and Providers

Populate src/main/resources/*.properties or the provided properties file with API keys and model preferences for OpenAI, Anthropic, and any local LLM endpoints. Adjust cost thresholds and safety rules in the decision-config YAML or properties file.

3

Run Locally

Start the project in Anypoint Studio with the configured Mule runtime, or use docker-compose up to launch the Mule app and the UI. Ensure the metrics exporter endpoint is reachable if you run Prometheus or a local observability stack.

4

Validate and Monitor

Use the included React UI or curl against the HTTP endpoints to submit prompts. Watch logs, metrics, and the audit trail to confirm semantic routing, cost-optimization decisions, and safety rejections. Tweak rules and rerun to iterate.

5

Customize Routing and Policies

Modify the DataWeave classifier, cost optimizer rules, or safety flows to reflect your business goals (e.g., latency targets, cost caps, regulatory constraints). Add new provider connectors or model mappings by following the existing connector template.

When to Use This

Choose this template when you need a ready-made LLM gateway with semantic routing, cost controls, and observability — it saves building classification, safety, connector plumbing, and dashboards from scratch.

Details

Version
v1.0.0
Size
95.2 KB
Published
5/27/2026
Updated
5/27/2026
Source Repository
Attribution
David Campuzano <dcampuzano@salesforce.com>