Skip to main content

OxygenAI

A locally-powered terminal AI coding assistant for Windows. The brain is Ollama running the qwen2.5-coder model; the agent is our own tool-calling loop — it can read/write files in your project, list directories, run shell commands (with confirmation), and run your test suite.

Quickstart

1. Install Ollama + pull the model

scripts\install_ollama.bat

This installs Ollama (winget first, direct download fallback), waits for the server on 127.0.0.1:11434, then pulls qwen2.5-coder:3b (~2 GB).

Want a smarter (but larger) model? After setup run: oxygenai /model qwen2.5-coder:7b — needs ~5 GB RAM.

2. Launch OxygenAI

Double-click run_oxygenai.bat, or from a terminal:

cmd /c run_oxygenai.bat

First run creates a .venv, installs dependencies, then starts the REPL.

3. Chat

oxygenai> write fib.py that prints the first 20 numbers

The agent streams its answer, then calls write_file, runs commands after you approve, runs tests with the detected runner, and saves every session.

Check health any time:

oxygenai doctor

Slash commands

Command What it does
/new Start a fresh session
/model <name> Switch model (e.g. /model qwen2.5-coder:7b)
/cwd <dir> Change working directory
/sessions List past sessions
/paste Multi-line input (finish with a line END)
/clear Clear screen
/auto on|off Toggle auto-confirm for shell commands
/exit Quit (also Ctrl-D)

CLI subcommands: oxygenai doctor, oxygenai sessions list|show|rm <id>, oxygenai config.

How it works

  • Model: local via Ollama's native /api/chat (SSE streaming). We use raw httpx, not the ollama SDK, so we own the stream parsing.
  • Agent loop: model → tool call → execute → result fed back → repeat, capped at max_tool_iterations (8). Denied commands aren't errors — the model sees status: denied and adapts.
  • Safety: file tools are sandboxed to the working directory (resolve_within rejects .. and symlink/junction escapes); shell commands pass a denylist → allowlist → interactive y/N/a gate.
  • Sessions: JSONL under %USERPROFILE%\.oxygenai\sessions; resumed verbatim.
  • UI: rich live panel with throttled incremental markdown, code-fence tracking, tool banners, usage footer.

Project-type detection

OxygenAI inspects the working directory each turn:

  • pyproject.toml / requirements*.txt / .py files → Python (tests: python -m pytest -v)
  • package.json / .js/.ts/.jsx → Node (tests: the scripts.test value, else npm test)
  • Both / neither → mixed / generic

Troubleshooting

oxygenai doctor shows "server not reachable" Start Ollama (tray icon) or run ollama serve, then re-run.

Model not pulled ollama pull qwen2.5-coder:3b.

Mojibake / ? box glyphs We set PYTHONUTF8=1 in the launcher. Use Windows Terminal (not legacy cmd with raster fonts) for best look.

Slow first response Cold model load takes 30–60 s on CPU. The UI shows a spinner.

Health after failure oxygenai doctor prints ✓/✗ for the four checks.

Auto device detection

OxygenAI auto-detects the machine on startup and picks the best model + settings for it — pure-stdlib, so it works on Windows, Linux, macOS, and mobile Android (Termux) / iOS (the .bat/.exe are Windows-only shortcuts; the core python -m oxygenai runs anywhere Python runs).

Detected tier RAM model num_ctx
lite < 5.5 GB qwen2.5-coder:1.5b 2048
mid 5.5–11 GB qwen2.5-coder:3b 3072
high > 11 GB (+GPU) qwen2.5-coder:7b 8192

Check what it chose:

oxygenai device

Your own config.json / OXYGENAI_* env overrides still win over the auto-detection (it only fills what you haven't explicitly set).

Low-RAM defaults

OxygenAI ships tuned for modest hardware (8 GB RAM, CPU-only):

Setting Default Why
model qwen2.5-coder:3b fits ~2 GB in RAM; 1.5b is faster but weaker code
num_ctx 3072 fast prompt processing; enough for agent turns
keep_alive 15m keeps the model hot so the next prompt is fast; /unload frees it
num_threads 4 (physical cores) avoids OMP oversubscription that stalls the UI
options num_batch: 128 snappier first token on a 4-core CPU
max_history_messages 40 bounded chat window sent to Ollama each turn
max_redraw_interval_ms 500 less CPU churn in the renderer

You can override per-run via env:

set OXYGENAI_NUM_CTX=2048
set OXYGENAI_KEEP_ALIVE=0
set OXYGENAI_NUM_THREADS=4
oxygenai repl

Or persistently in %USERPROFILE%\.oxygenai\config.json. /unload in the REPL frees the model from RAM immediately (useful before leaving your PC).

Development

.venv\Scripts\python.exe -m pytest -q

Unit tests mock Ollama (no network, no model needed).

Roadmap

  • Multi-model routing (claude-api provider mixing)
  • Diff preview before write_file
  • .oxygenai per-project config

Metadata

Release files for oxygenai 0.1.0

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

Source distribution (sdist)

Source distribution for oxygenai 0.1.0
File Size Uploaded Provenance Actions
oxygenai-0.1.0.tar.gz 65.5 kB Without provenance Details for oxygenai-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oxygenai 0.1.0
File Interpreter ABI Platform Actions
oxygenai-0.1.0-py3-none-any.whl Python 3 none any Details for oxygenai-0.1.0-py3-none-any.whl

Total release size: 127.7 kB

Release files / oxygenai-0.1.0.tar.gz

Download URL oxygenai-0.1.0.tar.gz
Size 65.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d4ac6d7e2d36911b00f2347dd078590d0bfc31682372e4d51ec8056e7ba75da7
BLAKE2b-256 checksum
How to use checksums
f0c7a7450cf680704ccd4c0002f0e326da67485d852da99953280e4627ba84e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / oxygenai-0.1.0-py3-none-any.whl

Download URL oxygenai-0.1.0-py3-none-any.whl
Size 62.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fd4438e8c316cc30d389a47335d25cd01493d38a861e1acec70f55a572bcb31
BLAKE2b-256 checksum
How to use checksums
17bc901671066abe3d4c8bc7a16844490a7eb67de9f553440f73cbd6e9caa67e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for oxygenai 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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