--- title: Jarvis Space emoji: 📚 colorFrom: yellow colorTo: purple sdk: docker pinned: false --- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # Jarvis AI Assistant A voice-enabled AI assistant with WebSocket communication, LLM integration, and MCP tools. ## Deployment to Hugging Face Spaces ### Directory Structure The application follows this structure: ``` jarvis-space/ ├── Dockerfile ├── backend/ │ ├── app.py │ ├── config.yaml │ ├── requirements.txt │ └── pretrained_models/ ├── frontend/ │ ├── index.html │ ├── script.js │ ├── style.css │ └── static/ ``` ### Deploying to Hugging Face Spaces 1. Create a new Space on Hugging Face with Docker template 2. Add the following secrets in the Space settings: - `HF_TOKEN`: Your Hugging Face token - `GOOGLE_MAPS_API_KEY`: (Optional) For Google Maps integration - `BRAVE_API_KEY`: (Optional) For Brave Search integration - `ACCUWEATHER_API_KEY`: (Optional) For weather information 3. Push your code to the Space repository 4. The Dockerfile will build and deploy your application ### Testing the WebSocket You can test the WebSocket connection by accessing: ``` https://your-space-name.hf.space/test_websocket.html ``` ### Troubleshooting If you encounter a 404 error: - Check the Space logs to ensure all services are running - Verify that static files are being served correctly - Make sure the frontend directory is properly copied in the Docker image ## Development ### Local Setup 1. Install dependencies: ```bash pip install -r backend/requirements.txt ``` 2. Run the application: ```bash uvicorn backend.app:app --host 0.0.0.0 --port 7860 --reload ``` ### Directory Structure - `backend/`: Contains the FastAPI application, LLM integration, and MCP tools - `frontend/`: Contains the web interface with WebSocket client - `Dockerfile`: Defines the container for deployment