Skip to content

Repository files navigation

🤖 Local LLM Visual Block Generator

A web-based visual programming platform that converts natural language prompts into Blockly programs using a locally running Large Language Model (Llama 3.2 via Ollama).

This project combines Flask, Blockly, and Ollama to provide an AI-powered visual programming environment where users can describe logic in plain English and automatically generate Blockly blocks.


🚀 Features

  • 🧠 Local AI using Ollama (Llama 3.2)
  • 💬 Natural language to Blockly generation
  • 🧩 Interactive Blockly Workspace
  • ⚡ Flask REST API
  • 🤖 AI Custom Blockly Category
  • 🔄 XML Validation
  • 📂 Modular Project Architecture
  • 🎨 Professional Dashboard UI
  • 🖥️ Runs completely offline
  • 📈 Easy to extend with custom blocks

🛠 Tech Stack

Technology Purpose
Python Backend
Flask Web Framework
JavaScript Frontend Logic
Blockly Visual Programming
Ollama Local LLM Runtime
Llama 3.2 AI Model
HTML5 Frontend
CSS3 Styling
Git Version Control
GitHub Source Code Hosting

📁 Project Structure

Local-LLM-Visual-Block-Generator/

│
├── app.py
├── requirements.txt
├── README.md
├── package.json
│
├── llm/
│   ├── ollama_client.py
│   ├── prompt_template.py
│   ├── response_parser.py
│   └── xml_validator.py
│
├── static/
│   ├── blockly/
│   ├── css/
│   ├── images/
│   └── js/
│       ├── blockly.js
│       ├── script.js
│       ├── chat.js
│       └── custom_blocks/
│           ├── ai_blocks.js
│           ├── python_blocks.js
│           ├── file_blocks.js
│           ├── api_blocks.js
│           └── utility_blocks.js
│
├── templates/
│   └── index.html
│
└── tests/

⚙️ Installation

Clone Repository

git clone https://github.com/Abhishek2k24/Local-LLM-Visual-Block-Generator.git

cd Local-LLM-Visual-Block-Generator

Create Virtual Environment

python -m venv venv

Windows

venv\Scripts\activate

Linux / macOS

source venv/bin/activate

Install Python Packages

pip install -r requirements.txt

Install Node Packages

npm install

Install Ollama

Download Ollama:

https://ollama.com/download


Download Llama 3.2

ollama pull llama3.2

Verify Installation

ollama list

Run Flask

python app.py

Open

http://127.0.0.1:5000

🧠 How It Works

User Prompt
      │
      ▼
Flask API
      │
      ▼
Prompt Template
      │
      ▼
Ollama
(Llama 3.2)
      │
      ▼
Generated Blockly XML
      │
      ▼
XML Validator
      │
      ▼
Blockly Workspace

🧩 AI Category

Current custom AI blocks include:

  • 🤖 Generate Text
  • 💬 Chat
  • 📝 Summarize
  • 🌐 Translate
  • 😊 Sentiment Analysis
  • 🔑 Extract Keywords
  • 💻 Generate Code
  • 📖 Explain Code
  • 🛠 Fix Code
  • 🧩 Generate Blockly XML

📌 Current Progress

  • ✅ Professional Dashboard
  • ✅ Blockly Integration
  • ✅ Local Ollama Integration
  • ✅ Prompt Template Engine
  • ✅ XML Parsing
  • ✅ XML Validation
  • ✅ AI Blockly Category
  • 🚧 Python Custom Blocks
  • 🚧 File Blocks
  • 🚧 API Blocks
  • 🚧 Utility Blocks

🔮 Future Roadmap

  • Python Blockly Category
  • File System Blocks
  • API Blocks
  • Utility Blocks
  • Drag & Drop AI Workflow
  • Blockly Code Execution
  • Python Code Generation
  • JavaScript Code Generation
  • Export Blockly Projects
  • Save Workspace
  • Load Workspace
  • User Authentication

📸 Screenshots

Dashboard

Dashboard


Blockly Workspace

Blockly Workspace


AI Custom Blocks

AI Blocks


AI Generated Program

Generated XML

👨‍💻 Author

Abhishek Anand

B.Tech Computer Science Engineering (AI)

GitHub:

https://github.com/Abhishek2k24


📄 License

This project is developed for educational and research purposes.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages