Habr AI→ original

MTS AI opened the AVI code — an external filter that keeps LLM within the law without retraining

MTS AI released AVI (Aligned/Agreement Validation Interface) — an external filter for LLM in Python and FastAPI — in open access. It checks requests for prompt attacks and model responses for toxicity, ethics, and legal violations. The package includes a RAG module and Docker with monitoring; new rules are added with a single phrase in natural language. The system was tested on the FinanceBench benchmark.

AI-processed from Habr AI; edited by Hamidun News
MTS AI opened the AVI code — an external filter that keeps LLM within the law without retraining
Source: Habr AI. Collage: Hamidun News.
◐ Listen to article

MTS AI has released an open-source working service AVI (Aligned/Agreement Validation Interface) on GitHub — an external filter independent of the model, which checks prompts for attacks and LLM responses for toxicity, ethics, and legal violations, without modifying the model weights.

What is the architecture of AVI

MTS AI presented the AVI concept last year as a "smart firewall" for LLMs: an input filter blocks prompt attacks before the request reaches the model, while an output filter checks the generated response for toxicity, ethics, and legal violations. Now MTS AI has refined the architecture and released a working implementation: a service in Python and FastAPI with input and output filters, a RAG module, and Docker deployment with monitoring.

  • Open source code published on GitHub
  • Stack — Python and FastAPI
  • Includes input and output filters, RAG module, Docker with monitoring (Prometheus, Grafana, Jaeger)
  • New filtering rules can be added with a single natural language phrase
  • The system was tested on the FinanceBench benchmark
  • Scientific description of the architecture published in MDPI Electronics journal

Why an external filter is needed if you can fine-tune the model

The key idea of AVI is not to retrain the LLM for each new legal or ethical requirement, but to keep the rules external, in a separate service. According to developers, this allows adding and changing rules without retraining cycles — a new requirement is formulated as a single natural language phrase, not as a set of new training examples. This also, they say, helps save on LLM training: there's no need to restart the expensive retraining process every time regulatory standards change.

At the same time, AVI is not tied to a specific model: since the filter works externally, at the level of incoming requests and outgoing responses, in theory it can be deployed in front of any LLM, not just the one it was originally developed for at MTS AI.

What this means

AVI is an example of how compliance with law and ethical norms is increasingly moved to a separate controlled layer on top of a model, rather than being embedded in its weights. For companies operating LLMs in regulated industries like finance, this is a way to adapt faster to new requirements without restarting expensive retraining each time rules change.

Frequently Asked Questions

What is AVI?

AVI (Aligned/Agreement Validation Interface) is a model-independent external filter for LLMs that checks incoming requests for prompt attacks and responses for toxicity, ethics, and legal violations.

What was AVI tested on?

Developers reproduced experiments on the FinanceBench benchmark and published a scientific description of the architecture in the MDPI Electronics journal.

Where can I get AVI code?

The working service in Python and FastAPI is released as open source on GitHub — including input and output filters, RAG module, and Docker deployment with Prometheus, Grafana, and Jaeger monitoring.

ZK
Hamidun News
AI news without noise. Daily editorial selection from 50+ sources. A product by Zhemal Khamidun, Head of AI at Alpina Digital.

Need AI working inside your business — not just in your newsfeed?

I build production AI for companies — custom CRM, internal tools, autonomous agents, workflow automation. Owned by you, shaped to your process, no per-seat tax. Built by Zhemal Khamidun, CPO of AlpinaGPT (AI platform, 6,000+ users).

What do you think?
Loading comments…