# 🚀 Quick Start Guide ## ⚡ Lokal testen (5 Minuten) ### Terminal 1 - Backend ```bash # Python Environment (optional aber empfohlen) python -m venv venv source venv/Scripts/activate # Windows: venv\Scripts\activate # Dependencies pip install -r requirements.txt # Backend starten python app.py ``` Backend läuft auf: **http://localhost:7860** ### Terminal 2 - Frontend ```bash npm install npm run dev ``` Frontend läuft auf: **http://localhost:5173** --- ## 🌍 Zu Hugging Face Spaces deployen ### Schritt 1: Space erstellen 1. Gehe zu [huggingface.co/spaces](https://huggingface.co/spaces) 2. Klick "Create new Space" 3. Name: `ai-chatbot` (oder wie du willst) 4. License: Choose Open Licence Lizenz 5. Space SDK: **Python** (sehr wichtig!) 6. Click "Create Space" ### Schritt 2: Files hochladen ```bash # Space Repository klonen git clone https://huggingface.co/spaces/YOUR-USERNAME/ai-chatbot cd ai-chatbot # Alle Dateien von deinem Projekt kopieren cp /path/to/AI_Chatbot_Site/* . ``` ### Schritt 3: Commit & Push ```bash git add . git commit -m "Initial commit - Zephyr chatbot" git push ``` ### Schritt 4: Warten! Spaces deployt automatisch. Das kann 2-10 Minuten dauern (beim ersten Mal länger, weil das Model runtergeladen wird). Du findest den Link auf der Space-Seite! --- ## 🔧 Troubleshooting ### "ModuleNotFoundError: No module named 'torch'" ```bash # Stelle sicher du in der richtigen virtualenv bist: which python # (oder 'where python' auf Windows) # Sollte in deinem Projekt-Ordner sein # Neu installieren pip install -r requirements.txt --upgrade ``` ### "Could not locate cuda_runtime.cuh" Das ist okay! Das Modell fällt automatisch auf CPU zurück (langsamer aber funktioniert) ### React-Port 5173 ist belegt ```bash npm run dev -- --port 3000 ``` ### Plugins werden nicht geladen Checke die Browser-Konsole (F12): ```javascript // In der Konsole prüfen: window.PluginAPI // Sollte existieren window.analytics // Sollte von analytics.js gefüllt sein ``` --- ## 📝 Plugin-Template schnell erstellen ```bash node scripts/create-plugin.js my-plugin-name ``` Erstellt eine neue `plugins/my-plugin-name.js` mit Template! --- ## 🎯 Nächste Schritte 1. **Modell wechseln**: Ändere `MODEL_NAME` in `app.py` 2. **Schneller machen**: ```python load_in_8bit=True # In app.py ``` 3. **Streaming**: Kommentar `# TODO: Streaming` in `app.py` ist für Token-by-Token Responses 4. **Custom Styling**: Edit `src/index.css` und `.app-container` CSS --- ## 📚 Weitere Ressourcen - [Hugging Face Spaces Docs](https://huggingface.co/docs/hub/spaces) - [Transformers Library](https://huggingface.co/docs/transformers) - [Zephyr Model Card](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) - [React Docs](https://react.dev) - [Vite Docs](https://vitejs.dev) --- **Happy hacking! 🚀**