Skip to content

ramaabdelgadir/LabSmith-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LabSmith AI

A powerful, AI-driven tool that "forges" custom interactive Python tutorials. Built using Streamlit, Ngrok, and Qwen2.5-Coder running with 4-bit Quantization for maximum efficiency.

Streamlit Ngrok Python Hugging Face Quantization

Image

📖 About The Project

LabSmith is a Client-Server application designed to generate high-quality coding tutorials on demand. It solves the problem of static learning by generating Interactive Jupyter Notebooks (.ipynb) where users can read concepts, see demo code, and solve practice problems with hidden solutions.

The Architecture:

  1. Local Client: A lightweight Streamlit app acts as the UI on your machine.
  2. Remote Server: A Kaggle/Colab notebook runs the heavy AI model using GPU acceleration.
  3. The Bridge: Ngrok securely tunnels the API traffic between the local app and the remote GPU.

✨ Key Features

  • ⚡ 4-bit Quantization: Utilizes BitsAndBytes to run the powerful Qwen2.5-Coder-7B model on consumer GPUs (like Kaggle P100/T4) with minimal memory usage.
  • 🔗 Ngrok Tunneling: Seamlessly connects your local machine to a remote cloud GPU, allowing you to run heavy models without local hardware.
  • 🧠 Strict JSON Enforcement: Uses deterministic generation strategies to force the LLM to output clean, parseable JSON.
  • Interactive Notebook Generation: Automatically compiles the AI output into a .ipynb file using nbformat.
  • Hidden Solutions: Features HTML <details> tags to hide answers until the user is ready.

🛠️ Tech Stack

  • Frontend UI: Streamlit - For a responsive and easy-to-use web interface.
  • AI Model: Qwen2.5-Coder-7B - A state-of-the-art coding LLM optimized for instruction following.
  • Inference Engine: Hugging Face Transformers - To load and run the model.
  • Optimization: BitsAndBytes - Used for 4-bit quantization to fit the model into limited VRAM.
  • Backend API: FastAPI & Uvicorn - To serve the generation endpoint.
  • Networking: Ngrok - To create a secure tunnel between the cloud GPU and the local client.
  • File Handling: nbformat - To programmatically construct Jupyter Notebooks.

📂 Project Structure

LabSmith-AI/
├── labsmith-ai-server.ipynb      # Remote Server (Runs Qwen + Ngrok + 4-bit Quantization)
├── app.py                         # Local Streamlit Client
├── requirements.txt               # Local dependencies
├── README.md                      # Documentation
│
├── assets/                        # Media & visual assets
│   ├── demos                     # Demo videos
│   └── screenshot                # App screenshot
│
├── notebooks/                     # Generated tutorial notebooks (.ipynb)
│
└── src/
    ├── model_utils.py             # API connection & validation logic
    └── notebook_maker.py          # .ipynb compilation logic

🛠 Installation & Setup

Part 1: The Remote Server (Kaggle/Colab)

  • Upload LabSmith-AI_server.ipynb to Kaggle.
  • Set the Accelerator to GPU P100 or T4.
  • Add your Ngrok Auth Token in the script.
  • Run the notebook to start the server.
  • Copy the Ngrok URL (e.g., https://xxxx.ngrok-free.app).

Part 2: The Local Client (Your Machine)

1. Clone the repository

git clone [https://github.com/ramaabdelgadir/labsmith-ai.git](https://github.com/ramaabdelgadir/labsmith-ai.git)
cd labsmith-ai

2. Install Dependencies

pip install -r requirements.txt

3. Run the App

streamlit run app.py

4. Connect Paste the Ngrok URL into the sidebar and start forging tutorials!

🎥 Demos


👤 Author Rama Abdelgadir
AI Engenieer | Passionate about efficient LLM deployment and educational tools.

About

LabSmith AI creates interactive Python tutorials as .ipynb notebooks on demand, powered by a quantized LLM and delivered via a local Streamlit app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors