๐ 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
๐ฆ 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 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: 1247.83
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]"
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
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": "0.4.0"} |
๐ 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?
- ๐ GitHub Issues
- ๐ Documentation
๐ค 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gpt_fusion-0.4.0.tar.gz.
File metadata
- Download URL: gpt_fusion-0.4.0.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47e48de9c449a9bd8fac84dc06880951023db7bfcec7eded5054b880e8d5b824
|
|
| MD5 |
e386585b5c2a5f6f3136add565be6aad
|
|
| BLAKE2b-256 |
e149491502b3915cdb3f4328ebd4f5cab7256f10a5ed74e444a3f090bb1ec367
|
Provenance
The following attestation bundles were made for gpt_fusion-0.4.0.tar.gz:
Publisher:
publish-to-pypi.yml on costasford/gpt-fusion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpt_fusion-0.4.0.tar.gz -
Subject digest:
47e48de9c449a9bd8fac84dc06880951023db7bfcec7eded5054b880e8d5b824 - Sigstore transparency entry: 2462264905
- Sigstore integration time:
-
Permalink:
costasford/gpt-fusion@295b8d35426b35f9f4519ab3bbaf742b44987107 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/costasford
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@295b8d35426b35f9f4519ab3bbaf742b44987107 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gpt_fusion-0.4.0-py3-none-any.whl.
File metadata
- Download URL: gpt_fusion-0.4.0-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4344d6bbf56e8f40e7f0f61165002e2165663fa7f6840ec71c68e622b708d16d
|
|
| MD5 |
34155c88a12c1f7eea0bf33869c7d8d3
|
|
| BLAKE2b-256 |
796ff63abc481b4d5f3c80b4d5ebc05659355118fe75584eccf08e73e55512f4
|
Provenance
The following attestation bundles were made for gpt_fusion-0.4.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on costasford/gpt-fusion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpt_fusion-0.4.0-py3-none-any.whl -
Subject digest:
4344d6bbf56e8f40e7f0f61165002e2165663fa7f6840ec71c68e622b708d16d - Sigstore transparency entry: 2462265396
- Sigstore integration time:
-
Permalink:
costasford/gpt-fusion@295b8d35426b35f9f4519ab3bbaf742b44987107 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/costasford
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@295b8d35426b35f9f4519ab3bbaf742b44987107 -
Trigger Event:
release
-
Statement type: