Skip to main content

🚀 GPT Fusion

The Python toolkit that makes AI integration effortless

GPT Fusion is a comprehensive Python library designed to streamline AI-assisted application development. It ships a real LLM client for OpenAI-compatible chat completions (OpenAI, Groq, a local Ollama server, anything speaking the same API), plus the text processing, web scraping, and interactive demo tooling it's had all along.

🎯 Why Choose GPT Fusion?

  • 🤖 Real LLM Client: OpenAI-compatible chat completions, works with OpenAI, Groq, local Ollama, or anything else on that API shape
  • ⚡ Zero Setup Friction: Install and start coding in seconds
  • 🛡️ Production Ready: Built-in security, performance optimizations, and error handling
  • 🔌 Modular Design: Use only what you need with optional dependencies
  • 📚 Rich Examples: Complete demo projects including Unity 3D games and auth systems
  • 🧪 Battle Tested: 80+ tests with 89%+ coverage and CI/CD pipeline

CI Python Version License Tests Coverage

📦 Install from PyPI • 🌐 Live Documentation • 🎮 Try Live Demo

🚀 Quick Start

📦 Installation

Quick Install:

pip install gpt-fusion

Full Installation (all features):

pip install "gpt-fusion[all]"

Python Version Support:

  • ✅ Python 3.10+
  • ✅ Python 3.11 (Recommended)
  • ✅ Python 3.12

⚡ Quick Start Example

import gpt_fusion

# 🔤 Smart text processing
text = "The quick brown fox jumps over the lazy dog"
print(f"Words: {gpt_fusion.word_count(text)}")
print(f"Reversed: {gpt_fusion.reverse_words(text)}")
print(f"Is palindrome: {gpt_fusion.is_palindrome('racecar')}")

# 📊 Powerful data analysis
data = gpt_fusion.load_numbers_from_csv('data/numbers.csv')
print(f"Average: {gpt_fusion.average_from_csv('data/numbers.csv', use_streaming=True)}")

# 🌐 Easy web scraping (with built-in security)
headlines = gpt_fusion.scrape("https://news.ycombinator.com", ".titleline > a")
print(f"Found {len(headlines)} headlines")

# 🚀 Generate small, real starter projects in seconds
print(gpt_fusion.create_csv_app('my-analytics-dashboard', with_api=True))
print(gpt_fusion.create_tailwind_ui('my-modern-webapp', dark_mode=True))

Output:

Words: 9
Reversed: dog lazy the over jumps fox brown quick The
Is palindrome: True
Average: 3.0
Found 30 headlines
my-analytics-dashboard
my-modern-webapp

🤖 LLM Integration

pip install "gpt-fusion[llm]"
export OPENAI_API_KEY=sk-...
from gpt_fusion import ask, LLMClient

# One-liner for a single question
reply = ask("Explain recursion in one sentence.")

# Or reuse a client across a multi-turn conversation
client = LLMClient(model="gpt-4o-mini")
reply = client.chat([
    {"role": "system", "content": "Answer in a single sentence."},
    {"role": "user", "content": "What's a closure?"},
])
client.close()

Points base_url anywhere that speaks the OpenAI chat completions API without changing your code. Verified working against Groq's free tier:

client = LLMClient(
    base_url="https://api.groq.com/openai/v1",
    model="llama-3.1-8b-instant",
    api_key=os.environ["GROQ_API_KEY"],
)

The same pattern works for a local Ollama server (base_url="http://localhost:11434/v1") or any other OpenAI-compatible endpoint.

🎛️ Optional Feature Sets

Choose the components you need:

# 🤖 LLM chat completions client
pip install "gpt-fusion[llm]"

# 🌐 Web scraping & HTTP clients
pip install "gpt-fusion[web]"

# 🚀 FastAPI backend with auto-docs
pip install "gpt-fusion[backend]"

# 🐦 Social media integration
pip install "gpt-fusion[twitter]"

# 🛠️ Asset optimization & building
pip install "gpt-fusion[build]"

# 🧪 Development tools
pip install "gpt-fusion[dev]"

# 🎯 Everything included
pip install "gpt-fusion[all]"

✨ Features

🤖 LLM Client

Chat completions for OpenAI-compatible APIs - real requests, real error handling, no vendor lock-in.

# Install: pip install "gpt-fusion[llm]"
from gpt_fusion import ask, LLMClient

ask("Summarize the plot of Hamlet in two sentences.")

client = LLMClient()  # reads OPENAI_API_KEY from the environment
client.chat("Hello!", temperature=0.2)

Raises ConfigurationError if no API key is available, and APIError if the request fails or the response comes back in an unexpected shape - both importable from gpt_fusion.

🐍 Python Utilities

Core text processing, math helpers, and CSV analysis tools.

import gpt_fusion

# Text processing
gpt_fusion.word_count("Hello world")  # 2
gpt_fusion.reverse_words("Hello world")  # "world Hello"
gpt_fusion.is_palindrome("racecar")  # True

# Math & CSV
gpt_fusion.average_from_csv("data.csv")
gpt_fusion.median_from_csv("data.csv")

🌐 Web Scraping

Simple web scraping utilities with BeautifulSoup integration.

# Install: pip install "gpt-fusion[web]"
import gpt_fusion

html = gpt_fusion.scrape("https://example.com")
# Returns clean text content

🚀 FastAPI Backend

Ready-to-deploy API server with auto-generated docs.

# Install: pip install "gpt-fusion[backend]"
import uvicorn
import gpt_fusion

# Start server
uvicorn.run(gpt_fusion.backend_app, port=8000)

🐦 Twitter Integration

Twitter bot utilities with OAuth support.

# Install: pip install "gpt-fusion[twitter]"
# Reads TWITTER_API_KEY, TWITTER_API_SECRET, TWITTER_ACCESS_TOKEN, and
# TWITTER_ACCESS_SECRET from the environment if not passed explicitly.
from gpt_fusion import TwitterBot

bot = TwitterBot()
bot.post_tweet("Hello from GPT Fusion!")

🎮 Interactive Demos

🔐 Enhanced Auth UI Kit

Modern, secure authentication system with comprehensive security features:

  • 🛡️ Rate limiting & input sanitization
  • 🎨 Beautiful glass-effect UI with dark mode
  • ♿ WCAG 2.1 AA accessibility compliance
  • 🔍 Real-time password strength validation
  • 📱 Fully responsive design

Try it: Enhanced Demo | Basic Version | Test Suite

🎯 Unity 3D Game Engine Integration

Complete game architecture demonstrating modern Unity patterns:

  • ⚡ Event-driven systems (no Update() polling)
  • 🏊 Object pooling for performance
  • 🎛️ Scriptable Object configuration
  • 🖥️ Modern UI with smooth animations
  • 🏗️ Interface-based architecture

Explore: Modern Scripts | Setup Guide

📊 Data Analysis Playground

High-performance CSV processing with streaming support for large datasets:

  • ⚡ Memory-efficient streaming for large files
  • 📈 Statistical analysis (mean, median, percentiles)
  • 🔒 Built-in security (path traversal protection)
  • 📋 Sample datasets included
$ python examples/tutorial.py
Values: [1.0, 2.0, 3.0, 4.0, 5.0]
Average: 3.0
Median: 3.0

Try: Tutorial Script | Sample Data

🛠️ Project Generator

Small, real starter kits - not empty stubs, each command below actually runs and produces working code:

# 📊 CSV demo script, plus a FastAPI wrapper over the same data
gpt-fusion create_csv_app my-analytics --with-api
# -> my-analytics/{app.py, numbers.csv, api.py}

# 🎨 Tailwind + Firebase auth UI (--dark-mode for the glass-effect variant)
gpt-fusion create_tailwind_ui my-webapp --dark-mode
# -> my-webapp/{index.html, app.js}

# 🚀 Both combined: a frontend/ + backend/ FastAPI app
gpt-fusion create_fullstack_app my-saas --auth --database
# -> my-saas/frontend/{index.html, app.js}
# -> my-saas/backend/{app.py, numbers.csv}

--auth adds a minimal HMAC-signed-token login flow (POST /login with demo/demo123, then a bearer token on every other route) and --database swaps reading the CSV live for a small SQLite-backed store - both demo-grade and clearly commented as such in the generated code, not production-hardened. Neither flag adds a new dependency beyond what gpt-fusion[backend] already needs.

(python -m gpt_fusion <command> ... works the same way as gpt-fusion <command> ... if you'd rather not rely on the installed console script.)

🚀 API & Deployment

💻 Local Development

Start the development server:

pip install "gpt-fusion[backend]"
uvicorn gpt_fusion.backend:app --reload --port 8000

Interactive Features:

  • 📝 Swagger UI: http://localhost:8000/docs
  • 🔧 ReDoc: http://localhost:8000/redoc
  • 📊 Health Check: http://localhost:8000/health

🌐 API Endpoints

Method Endpoint Description Example
GET / Welcome message {"message": "gpt-fusion backend"}
GET /greet/{name} Personalized greeting /greet/Alice{"message": "Hello, Alice! Welcome to gpt-fusion."}
GET /profile/{uid} Basic user profile {"uid": "42", "display_name": "User 42"}
GET /projects Available demo projects List with GitHub links
GET /health Liveness/version check {"status": "healthy", "version": "<installed gpt-fusion version>"}

🌐 Cloud Deployment

🚀 Deploy to Render (Recommended)

# render.yaml is included in the repo
git push origin main  # Auto-deploys via GitHub integration

🟣 Deploy to Heroku

# Procfile is included
heroku create my-gpt-fusion-app
git push heroku main

🐳 Deploy with Docker

FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install "gpt-fusion[backend]"
EXPOSE 8000
CMD ["uvicorn", "gpt_fusion.backend:app", "--host", "0.0.0.0", "--port", "8000"]

🛠️ Troubleshooting

Common Issues

❌ Installation fails on Python 3.9

# GPT Fusion requires Python 3.10+
pyenv install 3.11.0
pyenv local 3.11.0
pip install gpt-fusion

❌ Import errors with optional dependencies

# Install specific feature sets
pip install "gpt-fusion[web]"  # for scraping
pip install "gpt-fusion[backend]"  # for FastAPI

❌ CSV files not loading

# Ensure CSV has 'value' column header
import gpt_fusion
data = gpt_fusion.load_numbers_from_csv('data.csv', use_streaming=True)

🔍 Still having issues?

🤝 Contributing

🛠️ Development Setup

git clone https://github.com/costasford/gpt-fusion.git
cd gpt-fusion
pip install "gpt-fusion[dev]"  # Installs dev dependencies
pip install -e .  # Editable install
pre-commit install  # Git hooks for quality

🧪 Testing & Quality

# Run the full test suite (80+ tests)
pytest

# Check coverage (currently 89%+)
pytest --cov=src/gpt_fusion --cov-report=html

# Code formatting and linting
black .
flake8 .

# Run all quality checks
python scripts/run_checks.py

Project Structure

src/gpt_fusion/     # Main package
├── core.py         # Basic utilities  
├── llm.py          # LLM chat completions client (optional)
├── text_utils.py   # Text processing
├── analysis.py     # CSV/data tools
├── web_scraper.py  # Web scraping (optional)
├── backend.py      # FastAPI server (optional)
├── twitter_bot.py  # Twitter integration (optional)
└── starter_kits.py # Project templates

tests/              # Comprehensive test suite
docs/               # Jekyll documentation
examples/           # Usage examples

📖 GitHub Repository • 📦 PyPI Package • 🐛 Report Issues • 📄 MIT License


GPT Fusion - Practical demos of human-AI collaboration. Built with ❤️ and Python.

Release files for gpt-fusion 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpt-fusion 0.4.4
File Size Uploaded
gpt_fusion-0.4.4.tar.gz 64.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gpt-fusion 0.4.4
File Interpreter ABI Platform
gpt_fusion-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 116.0 kB

Release files / gpt_fusion-0.4.4.tar.gz

Download URL gpt_fusion-0.4.4.tar.gz
Size 64.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2498c46317987ba54d528f1907ec0dfb9b3bf2c25d80f91bda06b6de1acabd34
BLAKE2b-256 checksum
How to use checksums
2f2033f00c609226642239b2fb31a21f92eb9e1eb69970004d35180382d78096
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release files / gpt_fusion-0.4.4-py3-none-any.whl

Download URL gpt_fusion-0.4.4-py3-none-any.whl
Size 52.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33c607a5b4dfbcf571e01bea91e219784eedeac8a3edba39db5f8ac83a5a847f
BLAKE2b-256 checksum
How to use checksums
e91aa7d619eac4ebc38c0d541bc24d68a7e0944f5aa29d4d35e38d9215964c2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page