GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - biru-codeastromer/py2cpp: Python → C++ converter for competitive programming. React + FastAPI + Ollama (Qwen). Side-by-side run, compile-repair loop, CF boilerplate.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
backend
backend
 
 
frontend
frontend
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

py2cpp — AI Python → C++ (CF-ready)

Vercel FastAPI Ollama Model License

py2cpp converts Python to C++17 with a Codeforces-style boilerplate, then compiles and runs both versions side-by-side on the same input.
AI-first: Qwen2.5-Coder (via Ollama) + a compile-and-repair loop.
Live UI: https://py2cpp.vercel.app/


Requirements

  • macOS with Homebrew
  • Python 3.10+, Node 18+
  • Ollama installed

Quick start

  1. Model server
brew install ollama cloudflare/cloudflare/cloudflared
ollama serve
ollama pull qwen2.5-coder:7b
  1. Backend
cd backend
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
export OLLAMA_MODEL=qwen2.5-coder:7b
uvicorn main:app --host 0.0.0.0 --port 8000
  1. Frontend
cd frontend
echo "VITE_API_URL=https://<your-tunnel>.trycloudflare.com" > .env
npm install && npm run dev

The frontend is static. The backend (FastAPI + Ollama + g++) runs on your machine and must stay running.

  1. Public URL
cloudflared tunnel --url http://localhost:8000
# copy the https://<random>.trycloudflare.com URL

Notes: Deployment can be only for frontend via netlify or vercel ; backend would be running locally constantly to work

API

  • POST /ai/convert → body { "py": "" } → { "cpp": "<full c++ file>" }

  • POST /run/python → { "code": "", "stdin": "" }

  • POST /run/cpp → { "code": "<c++>", "stdin": "" }

  • GET /healthz → { "ok": true }

Key points:

  • macOS/Clang is handled by a fallback header set when <bits/stdc++.h> is unavailable.

  • Targeted at contest-style Python; highly dynamic features may require manual edits.

License

MIT © Birajit Saikia

About

Python → C++ converter for competitive programming. React + FastAPI + Ollama (Qwen). Side-by-side run, compile-repair loop, CF boilerplate.

py2cpp.vercel.app/

Topics

ai-codegencloudflare-tunnelcodeforcescompetitive-programmingfastapiollamapython-to-cppqwenreactvitejs

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.