Instructions to use Jasleen05/my-local-chatbot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jasleen05/my-local-chatbot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jasleen05/my-local-chatbot")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Jasleen05/my-local-chatbot", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jasleen05/my-local-chatbot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jasleen05/my-local-chatbot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jasleen05/my-local-chatbot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Jasleen05/my-local-chatbot
- SGLang
How to use Jasleen05/my-local-chatbot with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Jasleen05/my-local-chatbot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jasleen05/my-local-chatbot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Jasleen05/my-local-chatbot" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jasleen05/my-local-chatbot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Jasleen05/my-local-chatbot with Docker Model Runner:
docker model run hf.co/Jasleen05/my-local-chatbot
🧠 My Fine-Tuned Local Chatbot
A locally hosted AI chatbot powered by a fine-tuned DistilGPT2 model using Hugging Face Transformers. This chatbot is trained on the Stanford Alpaca Instruction Dataset, enabling it to follow instructions and provide helpful responses — all without relying on internet access.
🚀 Features
- 🔒 Fully local – no internet required after setup
- 🧠 Fine-tuned on Stanford Alpaca-style instructions
- ⚡ Fast inference with CUDA or CPU fallback
- 🌐 Flask API with simple HTML/CSS/JavaScript frontend
- 🎨 Customizable prompts and response formatting
- 🧾 Chat history saved using SQLite
- Dataset Used: Stanford Alpaca
📂 Project Structure
├── app.py # Flask API backend
├── train.py # Script for fine-tuning the model
├── chatbot_model/
│ └── trained_model_* # Your fine-tuned model directory
├── static/
│ ├── styles.css # Frontend styles
│ └── script.js
├── templates/
│ └── index.html # Web UI
├── requirements.txt
├── README.md # You are here!
├── download.py
├── preprocess.py
├── int_db.py
├── chat_history.db # Saves history of chats
└── processed_dataset.csv
Demo
💡 Sample Prompt
Human: What is the capital of France?
Assistant: The capital of France is Paris.
🏋️♀️ Training
python train.py
This will:
Download the Stanford Alpaca dataset
Fine-tune distilgpt2
Save it inside: chatbot_model/trained_model_YYYYMMDD_HHMMSS/
🖥️ Run the App
python app.py
Then visit: http://localhost:5005
❓ FAQ
Q: Does this work offline? ✅ Yes! Once the model is fine-tuned, no internet is needed.
Q: Can I run it on CPU? ✅ Yes, but it will be slower. A CUDA GPU is recommended for faster responses.
Q: Can I replace the model? ✅ Yes! You can fine-tune any Hugging Face-compatible model by modifying train.py.
🛠️ Tech Stack
- Flask – Web server backend
- Transformers – Hugging Face inference
- PyTorch – Deep learning engine
- HTML/CSS/JavaScript – Frontend
- Stanford Alpaca Dataset
- SQLite – For saving chat history
- Python
📜 License
MIT License – Free to use, modify, and share.
👩💻 Author
Jasleen Kaur Matharoo
📧 jasleen.matharoo@s.amity.edu
🌐 GitHub @Jasleen-05
Model tree for Jasleen05/my-local-chatbot
Base model
distilbert/distilgpt2