File size: 3,269 Bytes
54478f6
883b00b
 
 
 
 
 
 
54478f6
883b00b
 
 
 
 
 
 
 
54478f6
 
883b00b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54478f6
883b00b
54478f6
883b00b
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
title: Danish Villa Assistant
emoji: 🏡
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: "1.45.1"
app_file: src/app.py
pinned: false
short_description: AI-powered Danish real estate analysis
tags:
  - real-estate
  - ai
  - streamlit
  - nocodb
  - together-ai
  - property-analysis
---

# 🏡 Danish Villa Assistant

An AI-powered real estate analysis app that helps explore Danish villa properties with intelligent insights. Built with Streamlit, NocoDB, and Together AI for a digital innovation course.

## Features

- **Property Database**: Browse Danish villa listings with detailed information
- **Smart Filtering**: Filter properties by price, rooms, city, and energy rating
- **AI Analysis**: Ask natural language questions about the property market
- **Real-time Data**: Connected to NocoDB for live property data
- **Multiple AI Models**: Choose from various Together AI models including Gemma

## Tech Stack

- **Frontend**: Streamlit
- **Database**: NocoDB (no-code database)
- **AI/LLM**: Together AI (multiple model options)
- **Deployment**: Hugging Face Spaces

## Setup Instructions

### 1. Clone and Install Dependencies

```bash
pip install -r requirements.txt
```

### 2. Configure API Keys

You need to set up three secrets in your Hugging Face Spaces:

1. `TOGETHER_API_KEY` - Get from [Together AI](https://api.together.xyz/)
2. `NOCODB_API_TOKEN` - Your NocoDB API token
3. `NOCODB_ENDPOINT_PATH` - Your NocoDB table endpoint path (e.g., `/api/v2/tables/TABLE_ID/records`)

### 3. Run Locally

```bash
streamlit run src/app.py
```

## Deployment on Hugging Face Spaces

1. Create a new Space on [Hugging Face Spaces](https://huggingface.co/spaces)
2. Choose "Streamlit" as the SDK
3. Upload all files (`src/app.py`, `requirements.txt`, `README.md`)
4. Go to Settings → Repository secrets
5. Add your three secret keys:
   - `TOGETHER_API_KEY`
   - `NOCODB_API_TOKEN` 
   - `NOCODB_ENDPOINT_PATH`

## Usage

1. **Filter Properties**: Use the sidebar to filter by price, rooms, location, and energy rating
2. **Browse Listings**: View detailed property information in the main panel
3. **Ask AI Questions**: Use the AI assistant to get insights about the market
4. **Test Models**: Use the debug section to test different AI models

## Example Questions for AI

- "What's the average price range?"
- "Tell me about energy ratings in the data"
- "Which areas have the most expensive properties?"
- "How many properties are available in each city?"
- "What's the price per square meter trend?"

## Course Context

This app demonstrates key concepts in digital innovation:

- **No-code Database**: Using NocoDB for rapid data management
- **AI Integration**: Leveraging LLMs for natural language insights
- **Cloud Deployment**: Hosting on Hugging Face Spaces
- **Modern Web Apps**: Building with Streamlit for rapid prototyping

## License

Built for educational purposes as part of a digital innovation course.

## Support

For issues with:
- **Together AI**: Check [Together AI docs](https://docs.together.ai/)
- **NocoDB**: Check [NocoDB docs](https://docs.nocodb.com/)
- **Streamlit**: Check [Streamlit docs](https://docs.streamlit.io/)
- **Hugging Face Spaces**: Check [HF Spaces docs](https://huggingface.co/docs/hub/spaces)