π§ Hugging Face Inference Endpoint - Ready for Deplo2. Set app_port: 7860 in README.md headerment
β What's Been Created
The inference_point directory now contains a complete lightweight LLM inference endpoint that:
- π― Standard HF API: Provides Hugging Face-compatible REST API on port 8000
- π MCP Integration: Can connect to external MCP servers for enhanced capabilities
- π³ Docker Ready: Fully containerized for Hugging Face Spaces deployment
- β‘ Lightweight: Minimal dependencies for fast startup and inference
π Quick Start
Local Testing
cd inference_point
python app.py
# API available at http://localhost:7860
Standard HF API Usage
# Basic inference
curl -X POST http://localhost:7860/ \
-H "Content-Type: application/json" \
-d '{"inputs": "Hello world"}'
# With parameters
curl -X POST http://localhost:7860/ \
-H "Content-Type: application/json" \
-d '{
"inputs": "Tell me about product 123",
"parameters": {
"max_new_tokens": 150,
"mcp_server_url": "https://your-mcp-server.hf.space"
}
}'
π Files Created
app.py- Main FastAPI application with HF-compatible endpointsDockerfile- Container configuration for HF Spacesrequirements.txt- Lightweight dependencies (FastAPI, httpx, uvicorn)README.md- Comprehensive documentation for HF Spacesstart.sh- Startup script with health checkstest_api.sh- Complete API testing script.env.example- Environment configuration template
π Deployment Options
1. Hugging Face Spaces
- Create new Space with Docker SDK
- Upload all files from
inference_point/ - Set
app_port: 8000in README.md header - Configure
MCP_SERVER_URLenvironment variable
2. Hugging Face Inference Endpoints
- Use this Docker setup for custom inference endpoints
- Configure auto-scaling and instance types
- Set environment variables for MCP integration
π Architecture
HTTP Request β Lightweight LLM β [Optional MCP Server] β HF-Compatible Response
Key Features:
- Auto-detection: Automatically detects when to use MCP tools based on keywords
- Fallback: Works perfectly without MCP server (direct responses)
- Configurable: Can connect to different MCP servers per request
- Standard Format: Returns responses in standard Hugging Face format
π API Endpoints
POST /- Main inference endpoint (HF compatible)GET /health- Health check and MCP statusGET /info- Model and service informationGET /- API information and usage examples
π― Next Steps
- Deploy to HF Spaces: Upload to new Docker-based Space
- Connect MCP Server: Set
MCP_SERVER_URLto your MCP server Space - Scale as Needed: Use HF Inference Endpoints for production loads
- Integrate: Use standard HF API calls from your applications
β¨ Hugging Face Compliant
The inference endpoint is now fully HF compliant using port 7860 (HF standard) and can be deployed immediately to Hugging Face Spaces or Inference Endpoints. It provides a clean separation between the lightweight LLM inference and the MCP server, allowing independent scaling and deployment.
π Lightweight, Fast, and HF-Compatible!