ZenoBot Model - Hugging Face Deployment
This folder contains the necessary files to deploy ZenoBot as a Hugging Face API service.
Files Overview
modelfile
: Contains the system prompt and configuration for the modelapp.py
: FastAPI application that serves the model via HTTP APIrequirements.txt
: Python dependencies required to run the APIDockerfile
: Docker configuration for Hugging Face deploymentspace.yaml
: Configuration for Hugging Face Space
Deployment Options
1. Hugging Face Deployment
Using huggingface-cli
The easiest way to upload your model to Hugging Face:
Install the Hugging Face CLI:
pip install -U "huggingface_hub[cli]"
Login to Hugging Face:
huggingface-cli login
Upload your model files:
huggingface-cli upload Zeno0007/zenobot .
Alternative: Using Git
Push this folder to a Hugging Face Space:
git push huggingface main
Configure the Hugging Face Space to use the Dockerfile
API Usage
Example Request
curl -X POST "https://your-huggingface-space-name.hf.space/generate" \
-H "Content-Type: application/json" \
-d '{
"query": "Plan a 3-day trip to California starting on 15/04/2024",
"temperature": 0.1,
"max_tokens": 2048
}'
Example Response
{
"response": {
"tripDetails": {
"tripLengthHigh": false
},
"itinerary": [
{
"dayStart": "[DayStart]",
"date": "15/04/2024",
"morningStart": "[MorningStart]",
"morning": {
"name": "Golden Gate Bridge Visit",
"location": "San Francisco",
"description": "Start your California adventure with a visit to the iconic Golden Gate Bridge. Walk or bike across the bridge for stunning views of the bay and city skyline.",
"transportation": "Taxi"
},
"afternoonStart": "[AfternoonStart]",
"afternoon": {
"name": "Alcatraz Island Tour",
"location": "San Francisco Bay",
"description": "Explore the historic Alcatraz Federal Penitentiary with an audio tour narrated by former inmates and guards.",
"transportation": "Ferry"
},
"eveningStart": "[EveningStart]",
"evening": {
"name": "Fisherman's Wharf Exploration",
"location": "San Francisco",
"description": "Enjoy the lively atmosphere of Fisherman's Wharf, watching sea lions at Pier 39 and taking in views of the bay.",
"transportation": "Walking"
},
"additionalActivityStart": "[AdditionalActivityStart]",
"additionalActivity": {
"name": "Cable Car Ride",
"location": "San Francisco",
"description": "Take a ride on San Francisco's historic cable cars for a unique way to experience the city's steep hills and views."
},
"dayEnd": "[DayEnd]"
}
// Additional days...
]
}
}
Environment Variables
MODEL_ID
: Hugging Face model ID (default: meta-llama/Llama-3.2-3B-Instruct)PORT
: Port for the API server (default: 7860)