A newer version of the Gradio SDK is available: 6.20.0
metadata
title: Claude-Style Modular LLM Space
emoji: π€
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 5.15.0
python_version: '3.10'
app_file: app.py
pinned: false
license: mit
short_description: Claude-style chatbot with search and memory.
Claude-Style Modular LLM Chatbot
A production-grade, premium LLM chatbot interface optimized for Hugging Face Spaces (free tier).
It features a minimalist Claude-style interface (built with custom CSS and Gradio), an advanced reasoning system prompt, real-time web search (via DuckDuckGo), automatic web page scraping, and conversational memory.
π Key Features
- Claude-Style Minimalist UI: Sleek, elegant light/dark mode inspired by Anthropic's Claude, complete with high-quality typography, clean card structures, and responsive layouts.
- Tri-Mode Inference Engine:
- Local CPU (Quantized PyTorch): Run lightweight models (e.g.,
Qwen/Qwen2.5-1.5B-Instruct) locally on the free CPU tier (fits within 16GB RAM). - Zero-GPU (Free GPU Sharing): Dynamic GPU acceleration utilizing Hugging Face's shared Zero-GPU pool (for 7B/8B models like
Qwen/Qwen2.5-7B-Instruct). - HF Serverless Inference API: Instant, zero-overhead connectivity to massive models (like
Qwen/Qwen2.5-72B-InstructorMeta-Llama-3.3-70B-Instruct) using your Hugging Face API token.
- Local CPU (Quantized PyTorch): Run lightweight models (e.g.,
- Real-time Web Search & Scraper: Toggleable web-search capability that searches DuckDuckGo, scrapes page contents, and injects context directly into the prompt.
- Conversational Memory: Maintains session chat history dynamically.
- State-of-the-Art System Prompt: Tailored prompts that guide the model to provide detailed, step-by-step thinking, well-formatted markdown, and objective answers.
π οΈ Hugging Face Space Deployment
Click the button below to start your deployment:
How to Deploy in 3 Simple Steps:
- Create the Space: Click the button above, type
llmas the Space Name, and click Create Space at the bottom of the Hugging Face page. - Add your HF_TOKEN Secret: Go to your GitHub repository -> Settings -> Secrets and variables -> Actions -> Add a secret named
HF_TOKENcontaining your Hugging Face write-access token (from hf.co/settings/tokens). - Run GitHub Sync Action: Go to the Actions tab in your GitHub repository, select Sync to Hugging Face Spaces, and click Run workflow.
Method 1: Manual Git Push
If you prefer to deploy manually via terminal:
- Create a new blank Space on Hugging Face (SDK: Gradio).
- Push these files directly to your Space's repository:
git remote add hf https://huggingface.co/spaces/YOUR_HF_USERNAME/YOUR_SPACE_NAME git push -u hf main --force
Method 2: GitHub Action Auto-Sync (Fully Automated)
Your repository is pre-configured with a GitHub Action that automatically syncs code to Hugging Face on every commit:
- Create your Space on Hugging Face (SDK: Gradio).
- Go to your GitHub repository -> Settings -> Secrets and variables -> Actions.
- Create a New repository secret:
- Name:
HF_TOKEN - Value: Your Hugging Face Access Token (Write access).
- Name:
- Create a file in your repo at
.github/workflows/hf_sync.ymlusing the template below. Every time you rungit push origin main, GitHub will build and update your Hugging Face Space automatically!
π Access Control (Private Deployment)
To restrict access so only you can use the chatbot:
- In your Hugging Face Space, navigate to Settings -> Variables and secrets.
- Create a new Secret with:
- Name:
APP_PASSWORD - Value: Your chosen private passcode (e.g.,
my_private_passcode123).
- Name:
- Once saved, Hugging Face will prompt a secure login page when accessing the Space. You will log in using
adminas the username and your passcode as the password.
π» Manual Git Deployment
To push manually:
Create a new Space on Hugging Face.
Choose Gradio as the SDK.
Push these files to your Space's repository:
git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME git add . git commit -m "Deploying Claude-style chatbot" git push -u origin main --force
βοΈ Project Structure
βββ app.py # Space entrypoint
βββ requirements.txt # Python dependencies
βββ README.md # Space configuration & docs
βββ src/
βββ __init__.py
βββ config.py # Theme styling, system prompts, & model settings
βββ tools.py # Web Search & Web Scraping engine
βββ engine.py # Modular multi-backend inference runner
βββ ui.py # Custom Gradio interface components