File size: 1,960 Bytes
9911e3e
 
c7dcc92
 
 
9911e3e
 
 
 
c5df650
9911e3e
 
c7dcc92
 
c5df650
c7dcc92
 
 
c5df650
c7dcc92
 
 
c5df650
c7dcc92
 
 
c5df650
c7dcc92
c5df650
 
 
c7dcc92
c5df650
 
c7dcc92
 
 
 
 
 
 
 
 
 
c5df650
 
 
c7dcc92
 
 
 
c5df650
 
 
 
 
 
c7dcc92
9911e3e
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
---
title: Cojournalist Data
emoji: πŸ›οΈ
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
short_description: Swiss Parliamentary Data Chatbot with Llama-3.1-8B
---

# πŸ›οΈ CoJournalist Data

A Swiss Parliamentary Data Chatbot powered by Llama-3.1-8B-Instruct and the OpenParlData MCP server.

## Features

- πŸ€– **Llama-3.1-8B-Instruct** - Meta's 8B parameter model with native tool calling support
- 🌍 **Multilingual** - Support for English, German, French, and Italian
- πŸ› οΈ **Tool Calling** - Intelligent query routing to parliamentary data APIs
- πŸ”’ **Rate Limited** - 50 requests per day per user for cost control
- ⚑ **HF Inference Providers** - Fast inference via Novita and other providers

## Space Settings Required

**IMPORTANT:** To run this Space, configure the following:

### Environment Variables
- **Required:** `HF_TOKEN` - Your HuggingFace token with Inference Provider access
- Add this in Space Settings β†’ Repository secrets

### Hardware
- **CPU Basic** (Free) - Sufficient since inference happens via API

## Usage

Simply ask questions about Swiss parliamentary data in natural language:
- "Who are the parliamentarians from Zurich?"
- "Show me recent votes about climate policy"
- "What motions were submitted about healthcare in 2024?"

## Architecture

- **Model:** meta-llama/Llama-3.1-8B-Instruct (8B params)
- **Inference:** HuggingFace Inference Providers (Novita, etc.)
- **Framework:** Gradio + HuggingFace Hub
- **MCP Integration:** OpenParlData server for parliamentary data

## Cost

- **HF PRO:** $9/month (recommended)
- **Inference:** $2/month included credits + pay-per-use
- **Estimated Total:** ~$12/month for typical usage (1,500 requests/month)
- **Space Hardware:** FREE (CPU Basic)

With 50 requests/day limit, costs stay predictable and affordable.

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference