File size: 1,629 Bytes
433f1e9 |
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 |
---
title: My Custom Space
emoji: 🤖
colorFrom: blue
colorTo: red
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
---
# My Custom Space
An AI research assistant tailored for academic inquiry and scholarly dialogue
## Quick Deploy to HuggingFace Spaces
### Step 1: Create the Space
1. Go to https://huggingface.co/spaces
2. Click "Create new Space"
3. Choose a name for your Space
4. Select **Gradio** as the SDK
5. Set visibility (Public/Private)
6. Click "Create Space"
### Step 2: Upload Files
1. In your new Space, click "Files" tab
2. Upload these files from the zip:
- `app.py`
- `requirements.txt`
3. Wait for "Building" to complete
### Step 3: Add API Key
1. Go to Settings (gear icon)
2. Click "Variables and secrets"
3. Click "New secret"
4. Name: `OPENROUTER_API_KEY`
5. Value: Your OpenRouter API key
6. Click "Add"
### Step 4: Configure Access Control (Optional)
Your Space is configured with access code protection. Students will need to enter the access code to use the chatbot.
**Access Code**: `TLC`
To disable access protection:
1. Edit `app.py` in your Space
2. Change `ACCESS_CODE = "TLC"` to `ACCESS_CODE = ""`
3. The Space will rebuild automatically
### Step 5: Get Your API Key
1. Go to https://openrouter.ai/keys
2. Sign up/login if needed
3. Click "Create Key"
4. Copy the key (starts with `sk-or-`)
### Step 6: Test Your Space
- Go back to "App" tab
- Your Space should be running!
- Try the example prompts or ask a question
## Configuration
- **Model**: google/gemma-3-27b-it
- **Temperature**: 0.7
- **Max Tokens**: 500
- **API Key Variable**: OPENROUTER_API_KEY |