Model Routing
Each workload carries a risk tier. Sensitive calls route to private models. Non-sensitive calls can use cloud APIs. The decision is explicit, logged, and auditable.
Open Source · JVM · EU AI Act
Most AI frameworks help you build. TramAI helps you prove. It enforces EU AI Act obligations — model routing, guardrails, approval gates, audit logging — in the execution path, not in a compliance binder.
Architecture
TramAI sits between your application code and the AI model providers. Every AI call passes through a governance boundary that enforces:
Each workload carries a risk tier. Sensitive calls route to private models. Non-sensitive calls can use cloud APIs. The decision is explicit, logged, and auditable.
Schema validation, structured JSON outputs, rate limiting, and input/output boundaries. AI responses are deterministic and verifiable — not free-form text.
When a decision requires human review, the workflow stops and waits. The human can approve, override, or halt. Enforced in code, not in policy documents.
EU AI Act mapping
The EU AI Act (Regulation 2024/1689) requires specific technical and organisational controls for AI systems. TramAI maps directly to these obligations:
Structured, tamper-evident audit logs for every AI execution. Capture inputs, outputs, model version, provider, and human oversight decisions. Retention policies enforced at the runtime level — not in a compliance binder.
Approval gates, human-in-the-loop workflows, and suspension mechanisms. When a decision requires human review, the workflow stops and waits. Enforced in code, not in policy documents. The human can review, override, or halt the system.
Model routing with sovereignty constraints. Sensitive workloads stay on private models (Ollama, vLLM). Non-sensitive workloads can use cloud APIs. The routing decision is explicit, logged, and auditable — not an accidental consequence of whichever API was integrated first.
Schema validation, structured JSON outputs, rate limiting, and failure handling. AI responses are deterministic and verifiable. When a model fails, the fallback operates within governance constraints — not around them.
Explicit workload classification. Each AI call carries a risk tier (RESTRICTED, STANDARD, OPEN) that determines which models, providers, and guardrails apply. Risk boundaries are enforced at the routing layer, not in documentation.
Structured execution evidence that can be presented to auditors, regulators, or customers. TramAI emits runtime evidence when configured, including the model used, the guardrails applied, and the approval chain.
Stack
Comparison
| TramAI | LangChain | Spring AI | |
|---|---|---|---|
| Primary purpose | Governance & compliance | Prompt orchestration | AI integration for Spring |
| EU AI Act mapping | Explicit (Articles 9–15) | None | None |
| Approval gates | Built-in (suspension & resume) | Custom implementation | Custom implementation |
| Audit logging | Structured, tamper-evident | Basic callbacks | Micrometer (metrics) |
| Model routing | Risk-tier based, sovereignty-aware | Manual per-chain | Per-bean configuration |
| JVM / Spring Boot | Native (primary target) | Java port (community) | Native |
TramAI is not a replacement for LangChain or Spring AI. It is the governance layer that sits above them. You can use LangChain for prompt orchestration and TramAI for the compliance boundary.
Constant Labs provides implementation support, deployment, and EU AI Act compliance mapping for TramAI-based systems.
FAQ
TramAI is an open-source governed AI runtime for the JVM (Java, Kotlin, Spring Boot). It sits between your application code and the AI model providers, enforcing governance decisions in the execution path: model routing, guardrails, approval gates, audit logging, and human oversight. Instead of relying on manual compliance checklists, TramAI makes compliance controls part of the code.
LangChain and LlamaIndex are orchestration frameworks — they help you chain prompts and tools together. TramAI is a governance runtime — it enforces compliance decisions in the execution path. The key difference: with LangChain, you can accidentally send sensitive data to the wrong model or skip an approval step. With TramAI, those boundaries are enforced at the routing layer. TramAI is designed for teams that need to demonstrate compliance to auditors, not just build a working prototype.
Yes. TramAI is built for the JVM ecosystem. It provides a Spring Boot starter (tramai-spring-boot-starter) that integrates with Spring DI, configuration, and actuator. You can add TramAI to an existing Spring Boot application with minimal configuration. It also works standalone (tramai-standalone) for non-Spring projects.
TramAI is provider-agnostic. It supports OpenAI, Anthropic, Azure OpenAI, Google Gemini, AWS Bedrock, DeepSeek, Ollama, and vLLM out of the box. The key feature is that you can swap providers per workload without changing application code. A RESTRICTED workload routes to a private Ollama model; a STANDARD workload routes to OpenAI. The routing decision is explicit, logged, and auditable.
TramAI is under active development. The core sovereign approval path (model routing, guardrails, approval gates, audit logging) has a strong stability boundary. The surrounding control-plane features are more experimental. For production deployments, Constant Labs provides implementation support, configuration, and operational handover.
Yes. TramAI is open-source (MIT license). You can clone the repository, build it with Gradle, and use it in your own project. Constant Labs is the primary developer and provides implementation support, deployment, and compliance mapping. But the code is yours to use, modify, and distribute.