Spaces:
Running
Running
Delete faculty_config_guide.md
Browse files- faculty_config_guide.md +0 -181
faculty_config_guide.md
DELETED
@@ -1,181 +0,0 @@
|
|
1 |
-
# Faculty Configuration Guide
|
2 |
-
|
3 |
-
## Overview
|
4 |
-
|
5 |
-
The config.json file serves as a stable reference point for customizing your deployed AI assistant on Hugging Face Spaces. This guide explains how to securely manage and iterate on your assistant's configuration.
|
6 |
-
|
7 |
-
## Security Model
|
8 |
-
|
9 |
-
### Faculty-Only Access
|
10 |
-
- Configuration editing is restricted to faculty members only
|
11 |
-
- Students can use the chatbot but cannot modify settings
|
12 |
-
- Access is controlled via a faculty password set in environment variables
|
13 |
-
|
14 |
-
### Setting Up Faculty Access
|
15 |
-
|
16 |
-
1. **In your Hugging Face Space Settings:**
|
17 |
-
```
|
18 |
-
Settings → Variables and secrets → New secret
|
19 |
-
|
20 |
-
Name: FACULTY_CONFIG_PASSWORD
|
21 |
-
Value: [your-secure-password]
|
22 |
-
```
|
23 |
-
|
24 |
-
2. **Alternative Token-Based Access:**
|
25 |
-
```
|
26 |
-
Name: CONFIG_EDIT_TOKEN
|
27 |
-
Value: [generated-secure-token]
|
28 |
-
```
|
29 |
-
|
30 |
-
## Configuration Workflow
|
31 |
-
|
32 |
-
### Initial Deployment
|
33 |
-
|
34 |
-
1. **Generate deployment package** using ChatUI Helper
|
35 |
-
2. **Upload to Hugging Face:**
|
36 |
-
- app.py
|
37 |
-
- config.json
|
38 |
-
- requirements.txt
|
39 |
-
|
40 |
-
3. **Set environment variables:**
|
41 |
-
- `OPENROUTER_API_KEY`: Your API key
|
42 |
-
- `FACULTY_CONFIG_PASSWORD`: Faculty access code
|
43 |
-
- `SPACE_ACCESS_CODE`: (Optional) General access control
|
44 |
-
|
45 |
-
### Iterative Customization
|
46 |
-
|
47 |
-
1. **Access Configuration Tab:**
|
48 |
-
- Navigate to your deployed space
|
49 |
-
- Click "⚙️ Configuration" tab
|
50 |
-
- Enter faculty access code
|
51 |
-
|
52 |
-
2. **Edit Settings:**
|
53 |
-
- **System Prompt**: Refine assistant behavior
|
54 |
-
- **Temperature**: Adjust response creativity
|
55 |
-
- **Max Tokens**: Control response length
|
56 |
-
- **Examples**: Update sample prompts
|
57 |
-
- **Grounding URLs**: Add/remove reference sites
|
58 |
-
|
59 |
-
3. **Save and Test:**
|
60 |
-
- Click "💾 Save Configuration"
|
61 |
-
- Refresh page to apply changes
|
62 |
-
- Test with students before finalizing
|
63 |
-
|
64 |
-
## config.json Structure
|
65 |
-
|
66 |
-
```json
|
67 |
-
{
|
68 |
-
"name": "AI Assistant",
|
69 |
-
"description": "A customizable AI assistant",
|
70 |
-
"system_prompt": "You are a helpful teaching assistant...",
|
71 |
-
"model": "gemini/gemini-2.0-flash-thinking-exp-1219",
|
72 |
-
"temperature": 0.7,
|
73 |
-
"max_tokens": 500,
|
74 |
-
"examples": "['What is machine learning?', 'Explain neural networks']",
|
75 |
-
"grounding_urls": "[\"https://course-website.edu\"]",
|
76 |
-
"api_key_var": "OPENROUTER_API_KEY",
|
77 |
-
"enable_dynamic_urls": false,
|
78 |
-
"locked": false,
|
79 |
-
"lock_reason": "",
|
80 |
-
"last_modified_by": "faculty",
|
81 |
-
"last_modified_at": "2024-01-15 10:30:00"
|
82 |
-
}
|
83 |
-
```
|
84 |
-
|
85 |
-
## Best Practices
|
86 |
-
|
87 |
-
### 1. Iterative Refinement
|
88 |
-
- Start with a basic configuration
|
89 |
-
- Test with sample student queries
|
90 |
-
- Refine based on actual usage
|
91 |
-
- Document changes for other faculty
|
92 |
-
|
93 |
-
### 2. System Prompt Engineering
|
94 |
-
```
|
95 |
-
You are a teaching assistant for [Course Name].
|
96 |
-
Your role is to:
|
97 |
-
- Answer questions about course material
|
98 |
-
- Guide students without giving direct answers
|
99 |
-
- Encourage critical thinking
|
100 |
-
- Reference course materials when relevant
|
101 |
-
|
102 |
-
Important guidelines:
|
103 |
-
- Do not provide solutions to assignments
|
104 |
-
- Redirect homework questions to office hours
|
105 |
-
- Maintain academic integrity
|
106 |
-
```
|
107 |
-
|
108 |
-
### 3. Configuration Locking
|
109 |
-
- Lock configuration during exams
|
110 |
-
- Prevents accidental changes
|
111 |
-
- Clear communication with lock reason
|
112 |
-
|
113 |
-
### 4. Backup Strategy
|
114 |
-
- Export configuration before major changes
|
115 |
-
- Share configurations between courses
|
116 |
-
- Version control for semester changes
|
117 |
-
|
118 |
-
## Advanced Features
|
119 |
-
|
120 |
-
### Configuration Import/Export
|
121 |
-
1. **Export current config:**
|
122 |
-
- Click "📥 Export Config"
|
123 |
-
- Save for backup or sharing
|
124 |
-
|
125 |
-
2. **Import configuration:**
|
126 |
-
- Click "📤 Import Config"
|
127 |
-
- Select JSON file
|
128 |
-
- Review changes before saving
|
129 |
-
|
130 |
-
### Grounding URLs
|
131 |
-
- Add course websites
|
132 |
-
- Include syllabus links
|
133 |
-
- Reference documentation
|
134 |
-
- Limit to trusted sources
|
135 |
-
|
136 |
-
### Access Control Hierarchy
|
137 |
-
1. **Space Access Code**: Controls who can use the chatbot
|
138 |
-
2. **Faculty Password**: Controls who can edit configuration
|
139 |
-
3. **Configuration Lock**: Temporary edit prevention
|
140 |
-
|
141 |
-
## Troubleshooting
|
142 |
-
|
143 |
-
### Common Issues
|
144 |
-
|
145 |
-
**Cannot save configuration:**
|
146 |
-
- Verify faculty password is correct
|
147 |
-
- Check if configuration is locked
|
148 |
-
- Ensure proper JSON formatting
|
149 |
-
|
150 |
-
**Changes not taking effect:**
|
151 |
-
- Refresh the page after saving
|
152 |
-
- Clear browser cache if needed
|
153 |
-
- Check browser console for errors
|
154 |
-
|
155 |
-
**Students report access issues:**
|
156 |
-
- Verify SPACE_ACCESS_CODE if set
|
157 |
-
- Check API key configuration
|
158 |
-
- Review recent configuration changes
|
159 |
-
|
160 |
-
### Configuration Recovery
|
161 |
-
|
162 |
-
If configuration becomes corrupted:
|
163 |
-
1. Access Space Files directly
|
164 |
-
2. Download config_backup_*.json
|
165 |
-
3. Rename to config.json
|
166 |
-
4. Restart space
|
167 |
-
|
168 |
-
## Security Considerations
|
169 |
-
|
170 |
-
1. **Never share faculty password with students**
|
171 |
-
2. **Rotate passwords each semester**
|
172 |
-
3. **Monitor configuration changes**
|
173 |
-
4. **Use environment variables for sensitive data**
|
174 |
-
5. **Review grounding URLs regularly**
|
175 |
-
|
176 |
-
## Support
|
177 |
-
|
178 |
-
For additional help:
|
179 |
-
- Check the ChatUI Helper documentation
|
180 |
-
- Contact your institution's IT support
|
181 |
-
- Review Hugging Face Spaces documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|