
g023 Code
DeepSeek V4 Flash Optimized Harness w/Ollama vision support
7 followers
DeepSeek V4 Flash Optimized Harness w/Ollama vision support
7 followers
A pure-Python AI coding agent harness optimized for DeepSeek v4 Flash that reads your project, searches code & the web, runs commands, and fetches pages, all while showing you exactly what it's doing and estimating what it costs. Built on DeepSeek's Responses API with native web search, subagent-first architecture, and a terminal-native interface. You can also use Ollama local or on another server to power the vision capabilities.




Free
Launch Team / Built With



New today (aka tl;dr): g023 Code 1.3.3 now includes DeepSeek Vision support and OpenRouter for vision (as well as Ollama). Support for automatically pausing when surge pricing engages (based on local timezone). Now makes a backup before writefile so it can restore if it screws something up (plus more clarity to the model as to what the read and write tools do). Now have the ability to set the current project's config as the global default for new projects. Now have docs separated by their relevance. Updated the pricing.
1.3.3
The theme of this release is money: knowing what the API costs before,
while, and after you spend it. DeepSeek moved to tidal (peak/off-peak) pricing
on 2026-08-17, and 1.3.3 makes that visible and steerable; it also adds a
second, third and fourth way to see images; it makes every edit recoverable;
and it lets settings live in two scopes instead of one.
Surge Pricing – /surge
DeepSeek uses peak/off-peak rates (Beijing time: peak 09:00–12:00 & 14:00–18:00, off‑peak half price). g023 now:
Displays peak windows in your local timezone (ds_times.json).
Prices /cost and status bar in real time (shows SURGE 2× during peaks).
Can automatically pause requests from surge_pause_buffer_minutes (default 5) before the first peak until after the last, resuming automatically. Ctrl‑C bypasses for that pass.
/surge notify on|off toggles transition banners.
/surge status counts down to next surge and shows the pause window.
All logic is local (no API call), pricing read from ds_pricing.json and ds_times.json.
OpenRouter Vision – /or
Vision now supports three backends (/vision backend none|ollama|deepseek|openrouter):
openrouter – uses OK.dat key, tries models from OR_VISION.json on HTTP 429. Default: google/gemma-4-26b-a4b-it:free. Tracks usage limits (/or tier free|credits).
deepseek – uses deepseek-v4-flash-vision-exp on the same key, with selectable wire format (/vision endpoint responses|chat_completions).
ollama – unchanged, uses vision‑capable models from the local/remote daemon.
Vision dispatches via subagents/vision.py + router.py, caches results by image hash + question + backend + model in SQLite, and is disabled entirely when not in use.
WriteFile Backups – Safe Edits
Every overwrite now snapshots the previous version to .g023/backups/<relative-path>/<timestamp>-<sha256-prefix>.bak (mirroring the file tree). Only the newest few versions are kept (default 5). The write result names the backup taken.
Skipped for files inside .g023/, new files, or unchanged content.
Disable with G023_WRITE_BACKUP=0; tune retention with G023_WRITE_BACKUP_KEEP (min 1).
Config Scopes – /config
Settings now live in two files:
Machine‑level config.json (next to K.dat) – applies to all projects.
Project‑level .g023/config.json – overrides the machine file for that project.
Commands:
/config – shows both files and active scope.
/config global – promotes current settings to global default.
/config save project – pins settings to this project.
/config save – saves to the active scope.
/config clear – removes project override, reverting to global.
/settings lists persistent keys; scope precedence is tested in test_config_scopes.py.
Usage & Call Accounting
usage.py now handles per‑model arithmetic with separate pricing for cache‑hit, cache‑miss, and output tokens – surge‑aware. If the API omits hit/miss splits, it assumes worst‑case and notes that.
The API‑call cost table in the README is now asserted by tests (test_call_accounting.py) against a stub client, ensuring honest reporting. test_usage_accounting.py covers cost arithmetic and handler contracts.
Tool Registry & Schemas Split
tools/registry.py – handles permissions, dispatch to local executors or subagents.
tools/schemas.py – owns wire schemas, including the web‑search marker ({"type": "web_search"}) executed server‑side by DeepSeek.
subagents/searcher.py – formalises local, metadata‑first grep (pure Python, zero API calls).
Documentation & Media
Docs split into per‑topic files (api.md, cache.md, cli.md, commands.md, config.md, data_files.md, ollama_client.md, openrouter_client.md, surge.md, tests.md, usage.md) plus an index in docs/README.md and a keep‑alive map in READ_1ST_CHANGES.txt.
Nineteen screenshots re‑taken on 1.3.3 – covering banners, command panels, a full read‑only agent turn, a file edit with backup line, and the new panels (/signals, /surge, /or, /config). All paths sanitised (/tmp/g023-shoot/...) to hide real home directories, usernames, or API keys.