--- title: MLOps AI Agent emoji: ♻️ colorFrom: indigo colorTo: green sdk: gradio sdk_version: 6.0.0 app_file: app.py pinned: false license: apache-2.0 short_description: Analyse csv, train, deploy, and get endpoint API. tags: - mcp-in-action-track-enterprise --- # 🧠 MLOps Agent: Auto Analysis, Training & Deployment A fully automated AI powered MLOps agent that you can run in a browser: Upload a CSV → Auto-analyze → Train a model → Deploy → Get example inference code. This app uses: * **Gradio** (streaming UI) * **OpenAI Responses API** (`gpt-5-mini` / `gpt-5`) * **Remote MCP server** for tool calling * **CSV→Model→Deployment** pipeline * **Streaming chat UX** with collapsible technical details * **Automatic Python & curl example code generation** >Link to the LinkedIn post: https://www.linkedin.com/feed/update/urn:li:ugcPost:7399748605563277312/ >Link to the YouTube video: https://www.youtube.com/watch?v=dzVgoG1uk0M ## 🚀 Features ### 📋 File Size Limits * **Hard cap**: 10MB maximum file size * **Soft cap**: 1.5MB recommended for optimal performance * **Large file handling**: If a file exceeds the soft cap, training will automatically use only the top 10K rows for processing * This optimization speeds up the training process and returns model IDs and responses faster ### 1. Natural Chat Interface Chat like a normal assistant — ask questions, discuss data, clarify tasks. ### 2. Automatic CSV Analysis Upload any structured CSV and ask: > “Analyze this dataset” The agent will produce: * Data shape * Target detection * Basic stats * Data quality issues * Recommendations ### 3. Model Training Ask: > “Train a model on this dataset” The agent will automatically: * Train a classifier or regressor * Evaluate metrics (Accuracy, F1, ROC-AUC…) * Summarize key performance signals ### 4. Automated Deployment Ask: > “Deploy the model” The MCP backend handles deployment and returns: * Deployment status * Example Python inference code * Example curl usage ### 5. Clean, Structured Responses Every response includes: **Key Summary → Example Usage → Technical Details (collapsible)** * Main explanation in clear Markdown * Python + curl examples outside the collapsible * Tools, parameters, and logs inside a `
` block ### 6. Full Streaming Output All assistant messages stream token-by-token for fast UX. ## 🖥️ UI Overview ### Chat + File Upload * Drag and drop a CSV * Type queries (analysis, training, deployment, follow-ups) * Live streaming assistant responses ### Collapsible Technical Details The agent always displays a `
` block containing: * Tool names used * Parameters passed * Training logs * Deployment logs * Raw JSON (if available) This keeps the main summary clean while still exposing full transparency. ### Clickable Examples * Pre-loaded examples for quick testing * Triggers analysis, training, deployment, and auto-deployment * Uses the included `data/heart.csv` and `data/housing.csv` dataset automatically ## 📦 Installation Clone the repo: ```bash git clone https://huggingface.co/spaces/MCP-1st-Birthday/mlops-agent cd mlops-agent ``` Install dependencies: ```bash pip install -r requirements.txt ``` Set your environment variable: ```bash export OPENAI_API_KEY="your-key-here" ``` Run the app: ```bash python app.py ``` ## 🧬 Architecture ``` User → Gradio Chat UI → OpenAI Responses API (streaming) → MCP Server (tools: analyze, train, deploy) → Outputs come back as structured signals → Assistant formats them using strict markdown schema → Gradio displays stream + collapsible logs ``` ## 🛠️ Tech Stack * Python 3.10+ * Gradio 6.x * OpenAI SDK * Remote MCP Tool Server (auto-train, evaluate, deploy) * Streaming I/O architecture