Skip to main content

Model Overview

This project provides an MLflow-compatible model that acts as a proxy to an external backend service. Instead of performing local machine learning inference, the model forwards user queries to a backend API and returns structured responses.

Request Format

The model expects input in JSON format following the MLflow scoring protocol.

Example Request

{
"inputs": [
{
"question": "Which documents mention institutions or universities?",
"dataset": "research_production",
"agent": "domain"
}
]
}

Field Descriptions

  • inputs (array) – A list of one or more query objects (each representing a single request).
  • question (string) – The user’s natural language query.
  • dataset (string) – Specifies which dataset to use (e.g. research_production, ai_ecosystem).
  • agent (string) – Selects which backend agent handles the request (e.g. domain, data_exploration).

Response Format

Example Response

{
"content": {
"images": [],
"text": "Documents mentioning institutions or universities are found in Articles 37, 56, and 68."
},
"explanation": {
"code": "",
"sources": [
{
"article": "Article 37",
"page": 20,
"title": "Law on Gender Equality",
"url": "https://example.com/doc1.pdf"
}
]
}
}

Field Descriptions

  • content (object) – The main user-facing answer.

    • text (string) – The generated natural language response.
    • images (array) – Optional list of images related to the answer.
  • explanation (object) – Supporting details for transparency and traceability.

    • code (string) – Optional code used to produce the answer (mainly for data queries).

    • sources (array) – List of references backing the answer:

      • article (string) – Referenced article or section.
      • page (number) – Page number in the document.
      • title (string) – Document title.
      • url (string) – Link to the source document.

Architecture

Client → MLflow → ModelMapper → Model → External API

Usage

mlflow models serve -m "models:/social_policy_making_model/1" --env-manager local -p 5001