Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6f2ebec
refactor(app): modularize Streamlit app and adopt src layout
ricardobalk Jul 31, 2026
3e6da29
feat(openai): add advanced response controls
ricardobalk Jul 31, 2026
a6a9569
feat(prompts): improve setup prompt presentation
ricardobalk Jul 31, 2026
0f35803
feat(cutoff): add validated historical date controls
ricardobalk Jul 31, 2026
5327802
feat(models): add capability-aware model options
ricardobalk Jul 31, 2026
77b3aaf
fix(prompts): remove outdated provider attribution
ricardobalk Jul 31, 2026
82d52de
docs: update features and development instructions
ricardobalk Jul 31, 2026
f83aae2
chore(release): bump version to 1.0.0-alpha.2
ricardobalk Jul 31, 2026
30e2871
chore: add Python quality toolchain
ricardobalk Jul 31, 2026
d7c13e1
feat(providers): define typed chat and option contracts
ricardobalk Jul 31, 2026
0665838
feat(openai): add dynamic provider adapter
ricardobalk Jul 31, 2026
53353db
chore: add provider SDK and environment configuration
ricardobalk Jul 31, 2026
6579768
feat(providers): add Claude and Ollama adapters
ricardobalk Jul 31, 2026
81e6db1
feat(ui): render provider schemas generically
ricardobalk Jul 31, 2026
5fd9264
fix(anthropic): preserve deterministic sampling options
ricardobalk Jul 31, 2026
8148309
test(ui): cover schema-driven option rendering
ricardobalk Jul 31, 2026
5b2e64c
test(app): cover unconfigured provider state
ricardobalk Jul 31, 2026
82b6950
chore(dev): install project quality tools
ricardobalk Jul 31, 2026
f81368c
docs: document provider configuration and architecture
ricardobalk Jul 31, 2026
9641c4c
chore(release): bump version to 1.0.0-alpha.3
ricardobalk Jul 31, 2026
5a0795e
chore(vscode): add automatic Streamlit task
ricardobalk Jul 31, 2026
f0a8ab2
chore(devcontainer): allow automatic workspace tasks
ricardobalk Jul 31, 2026
6622213
docs: explain automatic Dev Container startup
ricardobalk Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Based on the official Microsoft-maintained Python Dev Container template:
// https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "HackGPT Python",
"image": "mcr.microsoft.com/devcontainers/python:3-3.14-trixie",
"forwardPorts": [8501],
"portsAttributes": {
"8501": {
"label": "HackGPT (Streamlit)",
"onAutoForward": "openPreview"
}
},
"postCreateCommand": "python -m pip install -r requirements-dev.txt",
"customizations": {
"vscode": {
"settings": {
"task.allowAutomaticTasks": "on"
},
"extensions": [
"ms-python.python"
]
}
}
}
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copy to .env or export these variables in the process environment.
# Add only credentials for providers you intend to use.
OPENAI_API_KEY=
OPENAI_BASE_URL=

ANTHROPIC_API_KEY=
ANTHROPIC_BASE_URL=

# Omit OLLAMA_HOST to use the Ollama client's local default.
OLLAMA_HOST=http://localhost:11434
# Optional when connecting to Ollama Cloud or another authenticated endpoint.
OLLAMA_API_KEY=
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
app/.streamlit/secrets.toml
src/.streamlit/secrets.toml
.env
.env.*
!.env.example
__pycache__/
*.py[cod]
.venv/
36 changes: 36 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "HackGPT: Start Streamlit",
"type": "process",
"command": "python",
"args": [
"-m",
"streamlit",
"run",
"src/app.py",
"--server.address=0.0.0.0",
"--server.port=8501"
],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": true,
"problemMatcher": [],
"presentation": {
"reveal": "always",
"revealProblems": "never",
"focus": false,
"panel": "dedicated",
"clear": true,
"showReuseMessage": false
},
"runOptions": {
"runOn": "folderOpen",
"instanceLimit": 1,
"instancePolicy": "silent"
}
}
]
}
117 changes: 82 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,120 @@
# HackGPT

Welcome to HackGPT, a powerful and customizable AI chatbot interface designed specifically for developers. With a ChatGPT-like experience, HackGPT brings a host of key features to enhance your hacking capabilities and empower your development process.
HackGPT is a Streamlit chat interface with provider-neutral model discovery,
streaming, setup prompts, and schema-driven generation controls.

[![HackGPT Demo](images/demo.gif)](./images/demo.gif)
[![HackGPT Demo](static/images/demo.gif)](./static/images/demo.gif)

## Current Features
## Features

- **ChatGPT-like Interface**: Immerse yourself in a chat-like environment with streaming output and a typing effect. Enable or disable the typing effect based on your preference for quick responses.
- **Multiple providers**: Use OpenAI, Anthropic Claude, or Ollama without changing
the chat interface.
- **Dynamic model discovery**: The model picker reflects the models available to
the configured account or Ollama host. Models can be refreshed from the sidebar.
- **Capability-aware configuration**: Every model supplies its own typed option
schema, including defaults, ranges, choices, and conditional fields. Unsupported
controls are never sent to a provider.
- **Provider-neutral chat**: Text history and system prompts remain usable when
switching between compatible providers and models.
- **Streaming responses**: All provider adapters stream response text into the
existing chat interface.
- **Setup prompts and historical context**: Select a bundled or custom setup prompt
and optionally add a validated historical knowledge cutoff.

- **Fine-tuning**: Tailor your HackGPT experience with the sidebar's range of options. Choose from different models like GPT-3, GPT-4, or specific models such as 'gpt-3.5-turbo'. Fine-tune model response parameters and configure API settings.
The capability model already represents streaming, system prompts, tools,
structured output, image input, and reasoning. Adding UI for future capabilities
does not require provider-specific branches in the generic option renderer.

- **Set-up Prompt Selection**: Unlock more specific responses, results, and knowledge by selecting from a variety of preset set-up prompts. Additionally, craft your own custom set-up prompt for personalized interactions.
## Provider configuration

- **Knowledge Cut-off**: Utilize GPT-4's time-travel capabilities by setting a "knowledge cut-off" date. Limit the AI's knowledge to a specific time in the past and explore historical insights. Gain a greater understanding of historical events, cultural nuances, and prevailing trends.
Credentials and endpoints are read only from environment variables. They are not
entered or displayed in the Streamlit interface.

- **On-demand Switching**: Seamlessly switch between models (GPT-3, GPT-4, etc.) and set-up prompts to unlock diverse and more dynamic AI-generated responses. Benefit from the advanced contextual understanding and improved transfer learning capabilities of different models.
| Provider | Required | Optional |
| --- | --- | --- |
| OpenAI | `OPENAI_API_KEY` | `OPENAI_BASE_URL` |
| Anthropic | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` |
| Ollama | A reachable Ollama service | `OLLAMA_HOST`, `OLLAMA_API_KEY` |

## Getting Started
Copy the example file and fill in only the providers you use:

HackGPT is built using Python 3.9 and Streamlit. It can be easily deployed in a containerized environment using the included Docker Compose set-up.
```bash
cp .env.example .env
```

Docker Compose reads the root `.env` file automatically. For a local Python run,
export the variables into the process environment before starting Streamlit. If
`OLLAMA_HOST` is omitted, the Ollama client uses its local default. When Streamlit
runs in a container and Ollama runs on the host, set `OLLAMA_HOST` to an address
reachable from that container.

Provider availability is account- and deployment-specific. A configured provider
can still report a clear discovery error when credentials are invalid, its endpoint
is unreachable, or it has no compatible chat models.

To get started, follow the steps below:
## Getting started

### Docker Compose (recommended)
HackGPT requires Python 3.12 or newer.

The easiest way to run HackGPT is to use Docker Compose. To do so, run:
### Docker Compose

```bash
docker-compose up # -d to run in background
docker compose -f docker/docker-compose.dev.yml up
```

To stop the container, press `Ctrl+C` in the terminal window, or run:
Stop or remove the development service with:

```bash
docker-compose stop
docker compose -f docker/docker-compose.dev.yml stop
docker compose -f docker/docker-compose.dev.yml down
```

... in case you used the `-d` flag to run the container in the background.

To remove the container, run:
### Local development

```bash
docker-compose down
python -m pip install -r requirements-dev.txt
streamlit run src/app.py
```

### Docker (manually)
### VS Code Dev Container

If you don't want to use Docker Compose, you can also run the container manually. To do so, run:
Choose **Dev Containers: Reopen in Container** from the Command Palette. The
container installs the development requirements, forwards port 8501, and runs the
`HackGPT: Start Streamlit` workspace task when the folder opens. Its dedicated
integrated terminal is revealed automatically so startup messages, request logs,
and errors remain visible. The forwarded app also opens in a VS Code preview.

```bash
docker run --rm -p 8501:8501 -v $(pwd)/app:/app -w /app python:3.9-slim bash -c "pip install -r requirements.txt && streamlit run app.py"
```
Use `Ctrl+C` in that terminal to stop Streamlit. To start it again, run
**Tasks: Run Task** and select `HackGPT: Start Streamlit`. After changing
`.devcontainer/devcontainer.json`, use **Dev Containers: Rebuild and Reopen in
Container** so the updated container settings take effect.

### Local Python environment
## Quality checks

If you don't want to use Docker, you can also run HackGPT in a local Python environment. To do so, run:
Run the complete local verification suite from the repository root:

```bash
cd ./app
pip install -r requirements.txt
streamlit run app.py
ruff format --check src tests
ruff check src tests
mypy src tests
pytest
```

## Feedback

We hope this initial release of HackGPT serves as a valuable tool for developers, encouraging exploration and experimentation with GPT-based models. Your feedback on HackGPT is highly appreciated as it will help us shape future versions of the project.
## Architecture

We're thrilled to have you join us in this journey of unleashing new possibilities and customizability for developers with HackGPT!
- `src/app.py` — Streamlit entry point and provider-registry lifetime.
- `src/hackgpt/providers/types.py` — provider protocol, capabilities, option schemas,
normalised messages, validation, and user-facing provider errors.
- `src/hackgpt/providers/` — isolated OpenAI, Anthropic, and Ollama adapters plus the
provider registry.
- `src/hackgpt/ui/options.py` — generic schema-to-Streamlit widget rendering.
- `src/hackgpt/ui/sidebar.py` — provider/model discovery and application controls.
- `src/hackgpt/ui/chat.py` — provider-neutral history and streamed chat rendering.
- `src/hackgpt/prompts.py` — bundled setup-prompt loading and historical context.
- `src/hackgpt/state.py` — session-state initialisation and history normalisation.
- `tests/` — schema, selection, adapter translation, state, and Streamlit smoke tests.

## License

This project is licensed under the terms of the ISC license. See [LICENSE](LICENSE) for more details.
This project is licensed under the terms of the ISC license. See [LICENSE](LICENSE)
for details.
1 change: 0 additions & 1 deletion app/.streamlit/secrets.toml.example

This file was deleted.

Loading