Spaces:
Runtime error
Runtime error
push
Browse files
README.md
CHANGED
@@ -198,43 +198,55 @@ residential-architecture-assistant/
|
|
198 |
|
199 |
## π **Getting Started**
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
### **System Requirements**
|
202 |
|
203 |
```bash
|
204 |
-
# Core Dependencies
|
205 |
Python >= 3.8
|
206 |
-
OpenAI API Access
|
207 |
-
LangGraph >= 0.0
|
208 |
-
LangChain >= 0.
|
209 |
Gradio >= 4.0.0
|
210 |
|
211 |
# Essential Dependencies
|
212 |
python-dotenv >= 1.0.0 # Environment management
|
213 |
```
|
214 |
|
215 |
-
### **Installation & Setup**
|
216 |
|
217 |
```bash
|
218 |
# 1. Clone the repository
|
219 |
git clone https://github.com/ZeruiW/Home_Design_Agent.git
|
220 |
cd Home_Design_Agent
|
221 |
|
222 |
-
# 2. Create virtual environment
|
223 |
python -m venv venv
|
224 |
source venv/bin/activate # On Windows: venv\Scripts\activate
|
225 |
|
226 |
# 3. Install dependencies
|
227 |
pip install -r requirements.txt
|
228 |
|
229 |
-
# 4.
|
230 |
-
|
231 |
-
#
|
232 |
|
233 |
-
# 5. Launch
|
234 |
python gradio_app.py
|
235 |
-
# β Opens http://localhost:
|
236 |
-
|
237 |
-
|
238 |
```
|
239 |
|
240 |
### **Alternative Launch Methods**
|
@@ -243,6 +255,8 @@ python gradio_app.py
|
|
243 |
# Command Line Interface (for debugging)
|
244 |
python main.py
|
245 |
|
|
|
|
|
246 |
```
|
247 |
|
248 |
---
|
@@ -411,13 +425,58 @@ routing_map = {
|
|
411 |
|
412 |
---
|
413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
## π **Production Deployment**
|
415 |
|
416 |
### **Performance Metrics**
|
417 |
|
418 |
- **Response Time**: < 3 seconds for routine consultations
|
419 |
- **Agent Coordination**: < 5 seconds for multi-agent workflows
|
420 |
-
- **State Persistence**:
|
421 |
- **Error Rate**: 0% (all NoneType issues resolved)
|
422 |
- **Reliability**: 7/7 agents fully operational
|
423 |
|
@@ -425,7 +484,7 @@ routing_map = {
|
|
425 |
|
426 |
- **Stateless Agents**: Support horizontal scaling
|
427 |
- **JSON Storage**: Easily upgradeable to database systems
|
428 |
-
- **Multi-User Support**:
|
429 |
- **API-Ready**: Agents exportable as REST/GraphQL endpoints
|
430 |
|
431 |
π **License & System Information**
|
|
|
198 |
|
199 |
## π **Getting Started**
|
200 |
|
201 |
+
### **π€ Hugging Face Spaces Deployment**
|
202 |
+
|
203 |
+
This application is ready for **one-click deployment** to Hugging Face Spaces:
|
204 |
+
|
205 |
+
#### **Option 1: Direct Hugging Face Spaces Deployment**
|
206 |
+
1. **Fork/Clone** this repository to your GitHub account
|
207 |
+
2. **Create a new Space** on [Hugging Face](https://huggingface.co/spaces)
|
208 |
+
3. **Select Gradio** as the SDK
|
209 |
+
4. **Connect your GitHub repository** to the Space
|
210 |
+
5. **Deploy automatically** - Hugging Face will use `app.py` and `requirements.txt`
|
211 |
+
|
212 |
+
#### **Option 2: Quick Deploy Button**
|
213 |
+
[](https://huggingface.co/spaces/new?template=gradio&sdk=gradio&filename=app.py)
|
214 |
+
|
215 |
### **System Requirements**
|
216 |
|
217 |
```bash
|
218 |
+
# Core Dependencies (All included in requirements.txt)
|
219 |
Python >= 3.8
|
220 |
+
OpenAI API Access (User provides their own key)
|
221 |
+
LangGraph >= 0.2.0
|
222 |
+
LangChain >= 0.3.0
|
223 |
Gradio >= 4.0.0
|
224 |
|
225 |
# Essential Dependencies
|
226 |
python-dotenv >= 1.0.0 # Environment management
|
227 |
```
|
228 |
|
229 |
+
### **Local Installation & Setup**
|
230 |
|
231 |
```bash
|
232 |
# 1. Clone the repository
|
233 |
git clone https://github.com/ZeruiW/Home_Design_Agent.git
|
234 |
cd Home_Design_Agent
|
235 |
|
236 |
+
# 2. Create virtual environment (recommended)
|
237 |
python -m venv venv
|
238 |
source venv/bin/activate # On Windows: venv\Scripts\activate
|
239 |
|
240 |
# 3. Install dependencies
|
241 |
pip install -r requirements.txt
|
242 |
|
243 |
+
# 4. Launch for Hugging Face Spaces (main app)
|
244 |
+
python app.py
|
245 |
+
# β Opens http://localhost:7860
|
246 |
|
247 |
+
# 5. Alternative: Launch full-featured local version
|
248 |
python gradio_app.py
|
249 |
+
# β Opens http://localhost:7862 (with user state management)
|
|
|
|
|
250 |
```
|
251 |
|
252 |
### **Alternative Launch Methods**
|
|
|
255 |
# Command Line Interface (for debugging)
|
256 |
python main.py
|
257 |
|
258 |
+
# Full multi-user interface (local development)
|
259 |
+
python gradio_app.py
|
260 |
```
|
261 |
|
262 |
---
|
|
|
425 |
|
426 |
---
|
427 |
|
428 |
+
## π **Hugging Face Spaces Configuration**
|
429 |
+
|
430 |
+
### **Deployment Files**
|
431 |
+
|
432 |
+
This repository includes everything needed for Hugging Face Spaces deployment:
|
433 |
+
|
434 |
+
```bash
|
435 |
+
π Required Files for HF Spaces:
|
436 |
+
βββ app.py # Main Gradio app (HF Spaces entry point)
|
437 |
+
βββ requirements.txt # Python dependencies
|
438 |
+
βββ README.md # Space documentation (this file)
|
439 |
+
βββ graph.py # Core LangGraph architecture
|
440 |
+
βββ agents.py # Multi-agent system
|
441 |
+
βββ state.py # State management
|
442 |
+
βββ user_state_manager.py # User persistence
|
443 |
+
βββ detailed_budget_agent.py # Specialized agents
|
444 |
+
```
|
445 |
+
|
446 |
+
### **Space Configuration**
|
447 |
+
|
448 |
+
**Recommended Hugging Face Space Settings:**
|
449 |
+
- **SDK**: Gradio
|
450 |
+
- **Python Version**: 3.9+
|
451 |
+
- **Hardware**: CPU (Basic) - sufficient for this application
|
452 |
+
- **Visibility**: Public (users provide their own OpenAI API keys)
|
453 |
+
- **License**: MIT
|
454 |
+
|
455 |
+
### **Environment Variables (Optional)**
|
456 |
+
|
457 |
+
For enhanced functionality, you can set these in your Space settings:
|
458 |
+
|
459 |
+
```bash
|
460 |
+
# Optional: Default values (users still need to provide their API key)
|
461 |
+
OPENAI_API_KEY="" # Users provide their own key via UI
|
462 |
+
```
|
463 |
+
|
464 |
+
### **Usage in Hugging Face Spaces**
|
465 |
+
|
466 |
+
1. **Users visit your Space**
|
467 |
+
2. **Enter their OpenAI API key** (securely handled, not stored)
|
468 |
+
3. **Initialize the assistant** with one click
|
469 |
+
4. **Start their architecture consultation**
|
470 |
+
|
471 |
+
---
|
472 |
+
|
473 |
## π **Production Deployment**
|
474 |
|
475 |
### **Performance Metrics**
|
476 |
|
477 |
- **Response Time**: < 3 seconds for routine consultations
|
478 |
- **Agent Coordination**: < 5 seconds for multi-agent workflows
|
479 |
+
- **State Persistence**: Session-based (in HF Spaces) / Full persistence (local)
|
480 |
- **Error Rate**: 0% (all NoneType issues resolved)
|
481 |
- **Reliability**: 7/7 agents fully operational
|
482 |
|
|
|
484 |
|
485 |
- **Stateless Agents**: Support horizontal scaling
|
486 |
- **JSON Storage**: Easily upgradeable to database systems
|
487 |
+
- **Multi-User Support**: Session isolation in HF Spaces
|
488 |
- **API-Ready**: Agents exportable as REST/GraphQL endpoints
|
489 |
|
490 |
π **License & System Information**
|
__pycache__/agents.cpython-311.pyc
ADDED
Binary file (53.1 kB). View file
|
|
__pycache__/app.cpython-311.pyc
ADDED
Binary file (16.3 kB). View file
|
|
__pycache__/detailed_budget_agent.cpython-311.pyc
ADDED
Binary file (15.1 kB). View file
|
|
__pycache__/graph.cpython-311.pyc
ADDED
Binary file (10.4 kB). View file
|
|
__pycache__/state.cpython-311.pyc
ADDED
Binary file (4.32 kB). View file
|
|
__pycache__/user_state_manager.cpython-311.pyc
ADDED
Binary file (17.6 kB). View file
|
|