MTS AI open-sources AVI, an external filter that keeps LLMs within the law without fine-tuning

MTS AI has open-sourced AVI (Aligned/Agreement Validation Interface), an external filter for LLMs built with Python and FastAPI. It screens incoming requests for prompt attacks and checks model responses for toxicity, ethics, and legal violations. The package includes a RAG module and a Docker setup with monitoring. New rules can be added with a single natural-language sentence. The system was tested on the FinanceBench benchmark.

AI-processed from Habr AI; edited by Hamidun News
MTS AI open-sources AVI, an external filter that keeps LLMs within the law without fine-tuning
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1The source code is published on GitHub
Key metric #2The stack is Python and FastAPI
Key metric #3The build includes input and output filters, a RAG module, and Docker with monitoring (Prometheus, Grafana, Jaeger)

MTS AI has released AVI (Aligned/Agreement Validation Interface) as open source on GitHub. The working service is a model-agnostic external filter: it checks prompts for attacks and checks LLM responses for toxicity, ethics, and legal violations, all without touching the model's weights.

What does AVI's architecture look like?

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

  • The source code is published on GitHub
  • The stack is Python and FastAPI
  • The build includes input and output filters, a RAG module, and Docker with monitoring (Prometheus, Grafana, Jaeger)
  • New filtering rules are added with a single natural-language sentence
  • The system was tested on the FinanceBench benchmark
  • A scientific description of the architecture was published in the journal MDPI Electronics

Why use an external filter if you can fine-tune the model?

The core idea behind AVI is to keep rules outside the model, in a separate service, instead of retraining the LLM for every new legal or ethical requirement. According to the developers, this lets teams add and change rules without a fine-tuning cycle: a new requirement is written as a single natural-language sentence rather than a set of new training examples. They say this also cuts AI training costs, since there's no need to rerun an expensive fine-tuning process every time a regulation changes.

AVI also isn't tied to a specific model. Because the filter operates externally, at the level of incoming requests and outgoing responses, it can in theory sit in front of any LLM, not just the one MTS AI originally built it for.

What does it mean?

AVI is an example of a growing trend: legal and ethical compliance is increasingly moved into a separate, controllable layer on top of the model instead of being baked into its weights. For companies running LLMs in regulated industries such as finance, this offers a way to adapt to new requirements faster without rerunning expensive fine-tuning every time the rules change.

FAQ

What is AVI?

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

What was AVI tested on?

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

Where can I get the AVI code?

The working Python and FastAPI service is available as open source on GitHub. It includes the input and output filters, the RAG module, and a Docker build with Prometheus, Grafana, and Jaeger monitoring.

Story

Key Questions Answered

What does AVI's architecture look like?

MTS AI first presented the AVI concept last year as a "smart firewall" for LLMs. An input filter blocks prompt attacks before a request reaches the model, and an output filter checks the generated response for toxicity, ethics, and legal violations. The company has now refined the architecture and released a working implementation: a Python and FastAPI service with input and output filters, a RAG module, and a Docker build with monitoring. The source code is published on GitHub The stack is Python and FastAPI The build includes input and output filters, a RAG module, and Do

Why use an external filter if you can fine-tune the model?

The core idea behind AVI is to keep rules outside the model, in a separate service, instead of retraining the LLM for every new legal or ethical requirement. According to the developers, this lets teams add and change rules without a fine-tuning cycle: a new requirement is written as a single natural-language sentence rather than a set of new training examples. They say this also cuts AI training costs, since there's no need to rerun an expensive fine-tuning process every time a regulation changes. AVI also isn't tied to a specific model. Because the filter operates externa

What does it mean?

AVI is an example of a growing trend: legal and ethical compliance is increasingly moved into a separate, controllable layer on top of the model instead of being baked into its weights. For companies running LLMs in regulated industries such as finance, this offers a way to adapt to new requirements faster without rerunning expensive fine-tuning every time the rules change.

What is AVI?

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

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…