A web-based visual programming interface that allows you to generate and execute Python code using Large Language Models (LLM) and Pyodide. Built with Vite, React, and LiteGraph.js.
- 🤖 LLM-powered Python code generation
- 🎨 Visual programming interface using LiteGraph.js
- 🐍 In-browser Python execution with Pyodide
- 📝 Monaco-based code editor
- 🔄 Real-time code execution and output display
- Node.js (v14 or higher)
- npm or yarn
- Modern web browser (Chrome, Firefox, Safari)
- Clone the repository:
git clone https://github.com/yourusername/vite-llm-python-runner.git
cd vite-llm-python-runner
- Install dependencies:
npm install
# or
yarn
- Create a configuration file:
cp config.json.example config.json
Edit config.json
and add your LLM API credentials:
{
"llmApi": {
"endpoint": "YOUR_LLM_API_ENDPOINT",
"apiKey": "YOUR_API_KEY"
}
}
- Start the development server:
npm run dev
# or
yarn dev
- Open your browser and navigate to
http://localhost:5173
vite-llm-python-runner/
├── src/
│ ├── components/
│ │ ├── CodeEditor.jsx # Monaco-based code editor
│ │ ├── LiteGraph.jsx # Visual programming interface
│ │ ├── Output.jsx # Code execution output display
│ │ └── ErrorBoundary.jsx # React error boundary component
│ ├── App.jsx # Main application component
│ ├── main.jsx # Application entry point
│ └── index.css # Global styles
├── public/ # Static assets
├── index.html # HTML entry point
├── package.json # Project dependencies and scripts
├── vite.config.js # Vite configuration
└── README.md # Project documentation
- Enter a natural language prompt describing the Python code you want to generate
- Click "Generate Code" to use the LLM to create the code
- Edit the generated code in the Monaco editor if needed
- Click "Run Code" to execute the Python code in the browser
- View the output in the output panel
- Use the visual programming interface to create more complex workflows
npm run dev
: Start development servernpm run build
: Build for productionnpm run preview
: Preview production build
- Vite - Next Generation Frontend Tooling
- React - A JavaScript library for building user interfaces
- Pyodide - Python with the scientific stack, compiled to WebAssembly
- LiteGraph.js - A graph node engine and editor
- Monaco Editor - The code editor that powers VS Code
- Tailwind CSS - A utility-first CSS framework
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the Pyodide team for making Python available in the browser
- Thanks to the LiteGraph.js team for the visual programming framework
- Thanks to all contributors and users of this project