An intelligent AI orchestration platform built with MCP (Model Context Protocol) Server that dynamically routes user requests to the most appropriate AI service based on:
- ๐ Data confidentiality
- โก Performance requirements
- ๐ฎ GPU availability
- ๐ Document processing
- ๐ Knowledge retrieval
The system is optimized for an NVIDIA GTX 1650 GPU, balancing local AI inference, document retrieval, OCR processing, and cloud-based AI services to provide fast, secure, and accurate responses.
- ๐ง Intelligent request routing using MCP Server
- ๐ Local LLM inference for confidential data
- โก Ultra-fast public AI responses using Groq
- ๐ RAG with pretrained ColBERT retrieval
- ๐ Intelligent OCR engine selection
- ๐ฎ GPU-aware resource management
- ๐ Automatic service fallback
- ๐ Optimized for GTX 1650 (4GB VRAM)
User Query
โ
โผ
MCP Server (Router)
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
Confidential Query General AI Query Image / PDF
โ โ โ
โผ โผ โผ
Local Ollama Groq API OCR Router
โ โ
โ GPU Available?
โ โโโโโโโโดโโโโโโโ
โ โ โ
โ Yes No
โ โ โ
โ EasyOCR / PaddleOCR Tesseract
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโ
โผ
Extracted Text
โ
โผ
ColBERT RAG Pipeline
โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
โ โ
Embedding & Indexing Semantic Retrieval
โ โ
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โผ
Ollama / Groq
โ
โผ
Final Response
The MCP Server intelligently assigns functions based on the user's request.
| Request Type | Assigned Function |
|---|---|
| Confidential data | Ollama |
| General AI questions | Groq |
| OCR request | OCR Router |
| Document Question Answering | ColBERT RAG |
| Internal Knowledge Search | ColBERT RAG |
| Image Text Extraction | EasyOCR / PaddleOCR / Tesseract |
Used for:
- Confidential company documents
- Internal business information
- Private knowledge bases
- Offline inference
- Sensitive AI workloads
Sensitive information should never leave the local environment.
Running Ollama locally ensures:
- Data privacy
- No cloud dependency
- Secure inference
- Low-latency responses
Used for:
- Public knowledge
- General AI questions
- Coding assistance
- Summarization
- Non-confidential requests
- Extremely fast inference
- Reduces local GPU usage
- Handles public AI workloads efficiently
- Improves overall response time
The platform uses pretrained ColBERT for semantic document retrieval.
Unlike traditional embedding-only retrieval, ColBERT performs late interaction retrieval, delivering higher search accuracy while maintaining excellent retrieval speed.
User Question
โ
โผ
Document Collection
โ
โผ
Chunking
โ
โผ
ColBERT Indexing
โ
โผ
Semantic Search
โ
โผ
Relevant Chunks
โ
โผ
LLM (Ollama / Groq)
โ
โผ
Answer
The project uses a pretrained ColBERT model because it provides:
- Better semantic retrieval
- Higher search accuracy
- Context-aware ranking
- Reduced hallucinations
- Fast document search
ColBERT uses the GPU for:
- Document indexing
- Embedding generation
- Semantic retrieval
- Similarity computation
Since ColBERT also consumes GPU memory, GPU resources are shared intelligently with other AI services.
The MCP Server manages these workloads to avoid GPU bottlenecks.
The platform is optimized for an NVIDIA GTX 1650 (4 GB VRAM).
Since multiple services may require GPU acceleration, the MCP Server prioritizes workloads dynamically.
| Service | GPU Usage |
|---|---|
| Ollama | High |
| ColBERT Retrieval | Medium |
| EasyOCR | Medium |
| PaddleOCR | Medium |
| Groq | None (Cloud) |
| Tesseract | CPU Only |
Priority order:
- Ollama
- ColBERT Retrieval
- EasyOCR
- PaddleOCR
- Tesseract (CPU)
- Groq (Cloud)
This scheduling minimizes GPU contention while maintaining responsive performance.
The OCR engine is selected automatically depending on GPU availability.
When GPU resources are available:
- EasyOCR
- PaddleOCR
Advantages:
- High accuracy
- Better multilingual support
- Faster extraction
- Handles scanned documents effectively
When Ollama or ColBERT is actively using the GPU:
- Tesseract OCR
Advantages:
- CPU-based
- Lightweight
- Fast startup
- Prevents long response delays
This ensures users are not waiting unnecessarily while GPU-intensive services are running.
User Query
โ
โผ
Is Confidential?
โ
โโโโโโดโโโโโ
โ โ
Yes No
โ โ
โผ โผ
Ollama Groq
โ
โผ
Need Documents?
โ
โผ
ColBERT Retrieval
โ
โผ
Generate Response
| Data Type | Processing |
|---|---|
| Confidential Documents | Local Ollama |
| Internal Knowledge Base | Local ColBERT RAG |
| Public Questions | Groq API |
| OCR Processing | Local |
| Vector Search | Local |
No confidential information is transmitted to external AI providers.
The MCP Server continuously optimizes performance by:
- Routing confidential data locally
- Sending public requests to Groq
- Using ColBERT for accurate retrieval
- Monitoring GPU availability
- Selecting the most suitable OCR engine
- Preventing GPU overload
- Reducing response latency
- Ollama
- Groq API
- ColBERT (Pretrained)
- RAG
- Vector Index
- EasyOCR
- PaddleOCR
- Tesseract OCR
- Python
- MCP Server
- NVIDIA GTX 1650 GPU
- Intelligent AI orchestration
- Secure local inference
- Accurate document retrieval
- GPU-aware scheduling
- Automatic OCR engine selection
- Lower response latency
- Better retrieval accuracy with ColBERT
- Reduced hallucinations using RAG
- Cloud and local AI integration
- Efficient GPU utilization
- Dynamic GPU memory monitoring
- Multi-agent orchestration
- Hybrid retrieval (ColBERT + Dense Embeddings)
- Streaming AI responses
- Vision Language Models (VLM)
- Automatic model selection based on confidence
- Distributed inference support
This project demonstrates an intelligent AI orchestration platform powered by an MCP Server, designed to optimize performance, security, and user experience.
By combining:
- ๐ Ollama for confidential local inference
- โก Groq for ultra-fast public AI responses
- ๐ Pretrained ColBERT for high-accuracy Retrieval-Augmented Generation (RAG)
- ๐ EasyOCR, PaddleOCR, and Tesseract for adaptive OCR processing
- ๐ฎ GPU-aware scheduling tailored for an NVIDIA GTX 1650
the platform delivers secure, scalable, and efficient AI workflows. The MCP Server intelligently routes every request based on data sensitivity, query type, and available computing resources, ensuring users receive accurate answers with minimal latency while protecting confidential information.