Lightweight desktop AI chat client built with Java 21, Swing, and Maven. Polished with FlatLaf and bundled IntelliJ themes. Chat transcripts can use native system WebViews via SwingWebView, Chromium through jcefmaven / JCEF, or a Swing fallback.
mvn clean compile
mvn exec:javaChat4J release artifacts are currently unsigned and not notarized. macOS Gatekeeper and Windows SmartScreen may warn or block the first launch. Only run artifacts you downloaded from the official GitHub Releases page, and verify checksums before bypassing operating-system warnings.
Download SHA256SUMS.txt alongside the artifact you plan to run, then verify it from the download directory:
# macOS / Linux; replace the filename with the artifact you downloaded
artifact="Chat4J-<version>.dmg"
awk -v artifact="$artifact" '$2 == artifact { print }' SHA256SUMS.txt | shasum -a 256 -c -# Windows PowerShell; replace the filename with the artifact you downloaded
$artifact = "Chat4J-<version>.msi"
$parts = (Get-Content SHA256SUMS.txt | Where-Object { $_ -match "\s$([regex]::Escape($artifact))$" }) -split '\s+', 2
$actual = (Get-FileHash -Algorithm SHA256 $artifact).Hash.ToLowerInvariant()
if ($actual -ne $parts[0]) { throw "Checksum mismatch: $artifact" }If macOS says Chat4J “cannot be opened” or is from an unidentified developer:
- Open Finder and locate
Chat4J.app. - Control-click / right-click the app and choose Open.
- Click Open again in the confirmation dialog.
If the app is still blocked, open System Settings → Privacy & Security, scroll to the Gatekeeper message for Chat4J, and click Open Anyway.
Advanced Terminal alternative:
xattr -dr com.apple.quarantine /Applications/Chat4J.app
open /Applications/Chat4J.appAdjust the path if you installed Chat4J somewhere else.
If Windows SmartScreen appears:
- Click More info.
- Click Run anyway.
If Windows marks the downloaded file as blocked:
- Right-click the
.msior.exeand choose Properties. - On the General tab, check Unblock if present.
- Click Apply, then run the installer again.
mvn clean package
mvn testRun packaged jar:
java --enable-preview -jar target/chat4j-<version>.jar# Generate JaCoCo coverage report and enforce core non-UI coverage gates
mvn -Pcoverage verify
# Generate CycloneDX SBOM files in target/bom.xml and target/bom.json
mvn -Psbom verify
# Run OWASP Dependency-Check; fails on CVSS 7+
NVD_API_KEY=your-nvd-api-key mvn -Pdependency-audit verify
# Check available dependency/plugin updates
mvn versions:display-dependency-updates versions:display-plugin-updatesDependabot is configured in .github/dependabot.yml for Maven and GitHub Actions updates. The scheduled Security Audit workflow runs OWASP Dependency-Check weekly and uploads HTML/JSON reports. Configure a repository secret named NVD_API_KEY to avoid public NVD API rate limits during vulnerability data updates.
- Desktop chat UI (Swing + FlatLaf)
- Multi-provider model selection
- Streaming assistant responses
- Local history/settings persistence (SQLite by default, optional H2, Flyway migrations)
- Agent Mode with local workspace tools
- Speech to Text with cloud providers plus local Whisper.cpp/Vosk model management
ANTHROPIC_API_KEYGEMINI_API_KEY(alias:GOOGLEAI_API_KEY)OPENAI_API_KEYPERPLEXITY_API_KEYOPENROUTER_API_KEYGROQ_API_KEYELEVENLABS_API_KEY(speech-to-text/text-to-speech)DEEPGRAM_API_KEY(speech-to-text/text-to-speech)ASSEMBLYAI_API_KEY(speech-to-text)DEEPSEEK_API_KEYMISTRAL_API_KEYXAI_API_KEY
Whisper.cpp local speech-to-text does not require an API key after downloading a local model.
API-key providers can use tokens saved in Settings or environment variables. A token saved in Settings is stored in Chat4J's app-local encrypted token vault and takes precedence over environment variables. This local encryption protects against casual file browsing, but it is not OS keychain storage; anyone who can read both Chat4J secret files can decrypt saved tokens.
Environment variables remain supported. Replace sk-... with your real API key. Restart Chat4J after changing environment variables.
For the current terminal session:
export OPENAI_API_KEY="sk-..."
mvn exec:javaTo make it persistent, add the export line to your shell profile:
# zsh, default on modern macOS
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.zshrc
# bash
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.bashrcReload the profile or open a new terminal:
source ~/.zshrc # or: source ~/.bashrcOn macOS, apps launched from Finder/Dock may not inherit terminal variables. Chat4J tries to load your login shell environment, but if keys are still missing, either launch Chat4J from Terminal or set the variable for GUI apps:
launchctl setenv OPENAI_API_KEY "sk-..."For the current PowerShell session:
$env:OPENAI_API_KEY = "sk-..."
mvn exec:javaTo make it persistent for your Windows user account:
setx OPENAI_API_KEY "sk-..."Close and reopen PowerShell, Command Prompt, or Chat4J after running setx.
For the current Command Prompt session:
set OPENAI_API_KEY=sk-...
mvn exec:javaTo make it persistent:
setx OPENAI_API_KEY "sk-..."- OpenAI Codex
- GitHub Copilot
- LM Studio — OpenAI-compatible server at
http://localhost:1234/v1(no API key required) - Ollama — OpenAI-compatible endpoint at
http://localhost:11434/v1(no API key required)
- docs/README.md — full documentation index
Native installers are built with jpackage via Maven profiles.
Each profile must run on the target OS (cross-packaging is not supported).
Use OS-specific profiles:
# macOS (.dmg)
mvn -Pjpackage-mac verify
# Windows (.msi) — requires WiX Toolset 3.x
mvn -Pjpackage-win verify
# Linux (.deb) — requires dpkg
mvn -Pjpackage-linux verifyOutput artifacts are written to target/dist/.
GitHub Actions builds unsigned release artifacts for version tags and manual reruns:
git tag v26.6.13
git push origin v26.6.13The release workflow publishes the shaded jar, macOS .dmg, Windows .msi, Linux .deb, SBOM files, and SHA-256 checksums.
Apache License 2.0 — see LICENSE.
