test-bot / README.md
milwright's picture
Upload 4 files
722e654 verified
|
raw
history blame
1.98 kB
metadata
title: CCNY Data Science Assistant
emoji: 🤖
colorFrom: blue
colorTo: red
sdk: gradio
sdk_version: 5.38.0
app_file: app.py
pinned: false
license: mit
short_description: Assistant for Foundations of Data Science at CCNY

CCNY Data Science Assistant

Assistant for Foundations of Data Science at CCNY

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

Your Space is configured with access code protection. Students will need to enter the access code to use the chatbot.

  1. Go to Settings (gear icon)
  2. Click "Variables and secrets"
  3. Click "New secret"
  4. Name: SPACE_ACCESS_CODE
  5. Value: TLC
  6. Click "Add"

Important: The access code is now stored securely as an environment variable and is not visible in your app code.

To disable access protection:

  1. Go to Settings → Variables and secrets
  2. Delete the SPACE_ACCESS_CODE secret
  3. The Space will rebuild automatically with no access protection

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: openai/gpt-4o-mini-search-preview
  • Temperature: 0.7
  • Max Tokens: 750
  • API Key Variable: OPENROUTER_API_KEY