metadata
title: Lightweight LLM with MCP Integration
emoji: π§
colorFrom: green
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
license: mit
tags:
- llm
- mcp-integrated
- inference
- fastapi
- prestashop
short_description: Lightweight LLM with integrated PrestaShop MCP tools
Lightweight LLM with Integrated MCP
A lightweight Large Language Model inference endpoint with integrated MCP (Model Context Protocol) server for enhanced PrestaShop capabilities. Everything runs in a single container for maximum efficiency and simplicity.
π Features
- Lightweight Architecture: Single container with minimal dependencies
- Hugging Face Compatible: Standard HF API format support
- Integrated MCP: Built-in PrestaShop MCP server (no external dependencies)
- Fast Inference: Optimized for quick response times with local MCP calls
- PrestaShop Ready: Direct integration with PrestaShop APIs
- Docker Single Container: Everything in one container for easy deployment
π‘ API Endpoints
Main Inference Endpoint: POST /
Hugging Face compatible format
Request:
{
"inputs": "What are the features of product 123?",
"parameters": {
"max_new_tokens": 150,
"temperature": 0.7,
"prestashop_api_url": "https://your-shop.com"
}
}
Response:
[
{
"generated_text": "Product 123 is a premium item with advanced features..."
}
]
Health Check: GET /health
Service health and configuration status
Model Info: GET /info
Model and configuration information
π§ Configuration
Environment Variables
PRESTASHOP_API_URL: Default PrestaShop API URLMODEL_NAME: Hugging Face model to use (default: lightweight model)MAX_NEW_TOKENS: Default max tokens (default: 256)
Integrated MCP
The LLM includes a built-in MCP server with PrestaShop tools:
- Direct Integration: No network overhead, fastest possible responses
- Auto-Detection: Automatically detects when to use PrestaShop tools
- Fallback: Works without PrestaShop (direct responses)
- Single Container: Everything runs together for simplicity
π οΈ Usage
Direct Inference
curl -X POST https://your-inference-endpoint.hf.space/ \
-H "Content-Type: application/json" \
-d '{
"inputs": "Hello, how are you?",
"parameters": {"max_new_tokens": 100}
}'
Integrated MCP Inference
curl -X POST https://your-inference-endpoint.hf.space/ \
-H "Content-Type: application/json" \
-d '{
"inputs": "Tell me about product 123",
"parameters": {
"max_new_tokens": 200,
"prestashop_api_url": "https://your-shop.com"
}
}'
ποΈ Architecture
HTTP Request β Lightweight LLM β Integrated MCP Server β Enhanced Response
- Request Processing: Analyze user input for PrestaShop tool requirements
- Tool Decision: Determine if PrestaShop tools are needed
- MCP Integration: Call integrated MCP server directly (no network overhead)
- Response Generation: Generate final response with enriched PrestaShop data
- HF Format: Return in standard Hugging Face format
π Deployment
Hugging Face Spaces
- Create new Space with Docker SDK
- Upload all files from
inference_point/directory - Set app_port to 7860 (already configured in README.md header)
- Configure PRESTASHOP_API_URL environment variable
Hugging Face Inference Endpoints
- Use this Docker setup for custom inference endpoints
- Configure scaling and instance types as needed
- Set environment variables for PrestaShop integration
π Performance
- Startup Time: < 30 seconds
- Inference Speed: 1-3 seconds for direct responses
- MCP-Enhanced: 2-5 seconds (local integration, no network overhead)
- Memory Usage: Optimized for single container deployment
- Concurrent Requests: Supports multiple simultaneous requests
π Integrated MCP Tools
This service includes built-in PrestaShop MCP tools:
- get_product_details: Get complete product information
- get_product_features: Get product specifications and features
- get_product_images: Get product images and media
- search_products: Search the product catalog
Keywords that trigger MCP usage:
- product, price, stock, inventory
- order, customer, database
- search, find, get, fetch, check
- prestashop, shop, cart, purchase
π License
MIT License - Feel free to use and modify for your projects.
β‘ Lightweight & Fast: Optimized for production inference workloads.