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/sales.csv')
print(f"Average: {gpt_fusion.average_from_csv('data/sales.csv', use_streaming=True)}")

# ๐ŸŒ Easy web scraping (with built-in security)
headlines = gpt_fusion.scrape("https://news.ycombinator.com", "a.storylink")
print(f"Found {len(headlines)} headlines")

# ๐Ÿš€ Generate complete projects in seconds
gpt_fusion.create_csv_app('my-analytics-dashboard')
gpt_fusion.create_tailwind_ui('my-modern-webapp')

Output:

Words: 9
Reversed: dog lazy the over jumps fox brown quick The
Is palindrome: True
Average: 1247.83
Found 30 headlines
โœ… Created my-analytics-dashboard/ with FastAPI backend
โœ… Created my-modern-webapp/ with Tailwind CSS

๐Ÿค– 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]"
from gpt_fusion import TwitterBot

bot = TwitterBot(api_key, api_secret)
bot.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
๐Ÿ” Loading data/numbers.csv...
๐Ÿ“Š Values: [1.0, 2.0, 3.0, 4.0, 5.0]
๐Ÿ“ˆ Average: 3.0 | Median: 3.0
โšก Processing 1M rows in 2.3s (streaming mode)
โœ… Analysis complete!

Try: Tutorial Script | Sample Data

๐Ÿ› ๏ธ Project Generator

Instant project scaffolding with production-ready templates:

# ๐Ÿ“Š Data analysis dashboard with FastAPI
gpt_fusion create_csv_app my-analytics --with-api

# ๐ŸŽจ Modern web UI with Tailwind CSS
gpt_fusion create_tailwind_ui my-webapp --dark-mode

# ๐Ÿš€ Full-stack app with auth
gpt_fusion create_fullstack_app my-saas --auth --database

Generated projects include:

  • ๐Ÿ“ Complete documentation
  • ๐Ÿงช Pre-configured testing
  • ๐Ÿš€ Deployment scripts
  • ๐Ÿ”ง Development tooling

๐Ÿš€ 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

๐ŸŒ 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

Links

๐Ÿ“– GitHub Repository โ€ข ๐Ÿ“ฆ PyPI Package โ€ข ๐Ÿ› Report Issues โ€ข ๐Ÿ“„ MIT License


GPT Fusion - Practical demos of human-AI collaboration. Built with โค๏ธ and Python.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpt_fusion-0.3.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpt_fusion-0.3.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file gpt_fusion-0.3.0.tar.gz.

File metadata

  • Download URL: gpt_fusion-0.3.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gpt_fusion-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fdf93f15b0d77d5df72b7c5c7faea30cd8f5729c393d5025f71a7f960f50029c
MD5 75b8e5eff5035337b94241f7bc68c4d8
BLAKE2b-256 026ff1fa19e197e26388faf0eead50276e2ea3a016f85f1109831637bc087008

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpt_fusion-0.3.0.tar.gz:

Publisher: publish-to-pypi.yml on costasford/gpt-fusion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gpt_fusion-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: gpt_fusion-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gpt_fusion-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ac4876b734477ca02d7bdc7773f02bdcb7ca011859f54decb485f32b438753b
MD5 97c43f3042bfcbaaee4ee2c0ca9177e5
BLAKE2b-256 a5ee86c19ad6c45c2d391a9a112e1323bd354acbf6a7066a2019403078ed18cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpt_fusion-0.3.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on costasford/gpt-fusion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page