| title | PlotCraft | |
|---|---|---|
| sdk | gradio | |
| sdk_version | 6.28.0 | |
| python_version | 3.12 | |
| app_file | app.py | |
| models |
|
|
| short_description | Generate Python visualization code from natural language. |
PlotCraft is a fine-tuned Qwen2.5-3B assistant that converts natural-language requests into executable Python visualization code. This repository contains the Gradio application, FastAPI service, Docker configuration, automated tests, and GitHub Actions deployment pipeline.
Generated code is displayed for review and can be rendered as a PNG inside an isolated browser worker. Generated code is never executed on the server.
- Open the live demo.
- Describe the Python visualization you want.
- Select Generate Python Code.
- Review the generated Python code.
- Select Render Preview to display the chart in the browser.
- Copy the code if you want to use it in your own project.
Example request:
Create a Matplotlib bar chart with categories A, B, C and values 2, 5, 3.
Create and activate a virtual environment in Git Bash:
python -m venv .venv
source .venv/Scripts/activateInstall the dependencies and start the application:
pip install -r requirements.txt
python app.pyLocal execution uses the lightweight mock mode by default, so it does not download the production model.
Run the tests with:
python -m pytestBuild and start the container:
docker compose up --buildOpen the interactive API documentation at:
http://localhost:8000/docs
Available endpoints:
GET /healthchecks whether the service is running.POST /generateaccepts a prompt and returns generated Python code.
Stop the container with:
docker compose down
