Skip to content

The LLM project converts Python code to highly optimized C++ code for Linux Ubuntu. This application leverages advanced API integrations and a sleek Gradio UI to provide seamless code conversion and execution.

Notifications You must be signed in to change notification settings

frezazadeh/LLM-based-Python-to-Cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Python OpenAI Claude Hugging Face

⚡ Python to C++ High-Performance Code Converter

A web-based tool that converts Python code into high-performance C++ using LLMs (GPT-4o / Claude 3.5). It also lets you run and compare outputs of both Python and the optimized C++ implementation.

🚀 Features

  • Convert Python functions to optimized, low-latency C++.
  • Support for OpenAI GPT-4o and Anthropic Claude 3.5 Sonnet models.
  • Live code execution and output comparison for both Python and C++.
  • Built-in web interface powered by Gradio.
  • Auto-generates optimized.cpp and compiles using Clang with performance flags.
  • Stylish, modern UI with clean execution results.

🧠 Technologies Used


🛠️ Setup Instructions

1. Clone the Repository

Run the following commands in your terminal:

git clone https://github.com/frezazadeh/LLM-based-Python-to-Cpp.git
cd python-to-cpp-ai
pip install -r requirements.txt

2. Create a .env File and Add API Keys

Create a file named .env in the project root and add the following content:

OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_claude_api_key

3. Run the App

Run the application with:

python3 main.py

📚 Reference

edwarddonner

About

The LLM project converts Python code to highly optimized C++ code for Linux Ubuntu. This application leverages advanced API integrations and a sleek Gradio UI to provide seamless code conversion and execution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages