{"id":51229804,"url":"https://github.com/sk8erboi17/dstudio","last_synced_at":"2026-06-28T15:02:01.339Z","repository":{"id":363347296,"uuid":"1262231970","full_name":"sk8erboi17/DStudio","owner":"sk8erboi17","description":"Run DeepSeek V4 fully local: chat, a coding agent, and a design studio in one private desktop app.","archived":false,"fork":false,"pushed_at":"2026-06-16T19:08:54.000Z","size":37433,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-16T20:25:25.673Z","etag":null,"topics":["coding-agent","deepseek","deepseek-v4","design-tool","desktop-app","llm","local-ai","macos","offline","privacy","self-hosted"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sk8erboi17.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T18:30:56.000Z","updated_at":"2026-06-16T19:09:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sk8erboi17/DStudio","commit_stats":null,"previous_names":["sk8erboi17/dstudio"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sk8erboi17/DStudio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sk8erboi17%2FDStudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sk8erboi17%2FDStudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sk8erboi17%2FDStudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sk8erboi17%2FDStudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sk8erboi17","download_url":"https://codeload.github.com/sk8erboi17/DStudio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sk8erboi17%2FDStudio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34892547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coding-agent","deepseek","deepseek-v4","design-tool","desktop-app","llm","local-ai","macos","offline","privacy","self-hosted"],"created_at":"2026-06-28T15:01:57.814Z","updated_at":"2026-06-28T15:02:01.333Z","avatar_url":"https://github.com/sk8erboi17.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/logo.png\" width=\"80\" alt=\"DStudio local AI studio for DeepSeek V4\"\u003e\n\n# DStudio: Local AI Studio for DeepSeek V4\n\n**An open-source local AI studio for DeepSeek V4 and ds4: private chat, a local coding agent, Skills, Guided Security Analysis, a design agent, Web Search, Deep Research and Plan mode for Markdown planning files. Runs on your machine. No cloud required.**\n\n![license](https://img.shields.io/badge/license-BSD%203%20Clause-blue)\n![platform](https://img.shields.io/badge/platform-macOS_%7C_Linux_%7C_Windows-black)\n![ai](https://img.shields.io/badge/AI-100%25_local-success)\n![engine](https://img.shields.io/badge/engine-DeepSeek_V4-orange)\n![deps](https://img.shields.io/badge/dependencies-zero-brightgreen)\n![agents](https://img.shields.io/badge/agents-chat_%7C_code_%7C_design-purple)\n\n\u003c/div\u003e\n\nDStudio turns [ds4](https://github.com/antirez/ds4), antirez's local DeepSeek V4 inference engine, into a full desktop AI workspace: a private AI chat, a local coding agent, a design studio and a planning workspace in one native UI. It is built for people who want a **local-first Cursor/Lovable-style workflow** without sending code, prompts or design work to a remote API.\n\nIn plain terms: DStudio is a **ds4 GUI**, a **local DeepSeek V4 desktop app**, a **private coding agent** and a **local AI design/planning studio** packaged as one open-source project.\n\nOn macOS it ships as **DStudio.app**: double-click from Finder, no Terminal. On Windows it ships as a portable folder with `DStudio.exe` and the DS4 runtime binaries. The UI is a single vanilla `index.html` embedded in a small C launcher, so there is no Electron bundle, no framework build step, no CDN and no telemetry.\n\n## 30-second start\n\n```sh\nmake\nopen DStudio.app        # macOS\n# or: ./dstudio         # Linux/headless workflows\n```\n\nWindows users should use the portable zip and run `DStudio.exe`.\n\nOn first launch, DStudio runs a local system check for the engine folder, model,\nchat engine, agent, design runtime and Web Search. Missing pieces show a direct\nbutton such as **Choose**, **Download**, **Start** or **Settings**.\n\n## What You Can Do\n\n- Run **DeepSeek V4 locally** through a native macOS/Linux desktop interface.\n- Use a **private AI chat** with persistent KV cache, reasoning display, citations from optional Web Search and local history.\n- Run **Web Search or Deep Research** through DStudio's local browser/search helper, with read-page evidence and source cards.\n- Use a **local coding agent** that reads, edits and verifies files inside a folder you choose.\n- Browse and load **Skills**: focused local instructions for Agent, Design and imported cybersecurity workflows.\n- Run **Guided Security Analysis (GSA)** for authorized local source reviews or target-scoped security work, using imported cybersecurity skills and optional local tools.\n- Generate interface concepts with **ds4-design**, a design agent built on ds4.\n- Keep the engine private while still reaching the UI from another device on your LAN.\n\n## Modes\n\nA sidebar switches between Chat, Agent and Design. Each mode has its own reopenable conversation history, and each agent/design session keeps its own local KV state.\n\n### Chat\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/demo.gif\" width=\"820\" alt=\"DStudio Chat demo showing local DeepSeek V4 chat, file generation and canvas preview\"\u003e\n\n\u003c/div\u003e\n\nStreaming DeepSeek V4 chat backed by the ds4 server KV cache: the context lives server-side (prefix reuse, shown as *cached* tokens) and every message is saved locally. You get live tokens/s, collapsible reasoning, native MathML for LaTeX, syntax-highlighted code and optional Web Search sources through the local browser.\n\n## Search \u0026 Deep Research\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/search.gif\" width=\"820\" alt=\"DStudio Search and Deep Research demo showing live web evidence, citations and source cards\"\u003e\n\n\u003c/div\u003e\n\nSearch runs through DStudio's local web helper, not a hosted browsing service. **Web Search** is the fast mode: it plans targeted queries, reads the best pages, extracts facts and answers with clickable citations. **Deep Research** uses the same tools with a longer evidence loop: classify the request, search, read primary sources, extract facts, judge sufficiency, synthesize a grounded report and keep the source cards attached to the answer.\n\n### Agent\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/agent.gif\" width=\"820\" alt=\"DStudio Agent demo showing the local coding agent editing and validating files\"\u003e\n\n\u003c/div\u003e\n\n`ds4-agent` becomes a local coding agent: it reads and edits files, runs commands in a working directory you choose, renders folded tool calls/reasoning, and keeps a live plan. A post-edit verifier catches common syntax errors immediately, so the model can fix broken code in the same turn.\n\n## Skills: local task recipes\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/skills.png\" width=\"820\" alt=\"DStudio Skills picker showing categories, imported cybersecurity skills and local task recipes\"\u003e\n\n\u003c/div\u003e\n\nSkills turn DStudio from a general assistant into a focused specialist for the job in front of you. Pick a recipe, and the next Agent or Design turn inherits the right workflow, constraints and quality bar without restarting the model.\n\nThe picker feels like a small local skill marketplace: categories on the side, concise cards in the main view, and enough detail to choose confidently. Under the hood it stays simple and private: user skills, shipped skills and imported cybersecurity skills are local Markdown instruction packs, injected as runtime context only when you choose them or when GSA shortlists them for a bounded review.\n\n## GSA: guided security analysis\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/gsa.png\" width=\"820\" alt=\"DStudio GSA demo showing guided security analysis, imported cybersecurity skills and managed tool status\"\u003e\n\n\u003c/div\u003e\n\nGSA gives the Agent a security-analyst operating mode instead of a loose prompt. Turn it on, describe an **authorized** mission and optionally add a target URL; DStudio turns that into a guided run with a clear scope, relevant skills, target context and a paper trail of artifacts.\n\nThe experience is productized, but the mechanics stay inspectable: **selection** chooses files, hypotheses and relevant skills; **preflight** maps evidence and safe checks; **validation** gathers concrete proof with scripts or optional local tools; **report** produces a compact verdict with sources, limitations and next actions. External recon tools are treated as helpers, not magic: DStudio shows what each one does, lets you disable them, and handles missing Go/Python/Cargo or package managers without blocking the run.\n\n## Design: a studio built **on** ds4\n\nDesign is not a chat skin. It is a separate local design agent that runs a designer's pipeline end to end. **`ds4-design` is DStudio's own extension to ds4**: it lives in this repo (`extension/design/ds4_design.c`), uses the same DeepSeek V4 engine, and has its own system prompt, tools, staged flow and native structured events.\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/design.gif\" width=\"820\" alt=\"DStudio Design demo showing the brief, questions, generation progress, proposals and canvas pipeline\"\u003e\n\n\u003c/div\u003e\n\nThe whole pipeline, from a one-line idea to laid-out screens:\n\n- **1 · Brief and questions.** Design starts with a structured interview instead of a blank prompt: what you're making, target platform, tone, brand direction, scale and constraints.\n- **2 · Generating.** It loads the right skills/design systems, writes a short plan, builds the screens and shows live progress from real runtime events instead of raw tool noise.\n- **3 · Proposal.** It can offer distinct directions to compare side by side, each with a name and rationale; pick one to refine or use.\n- **4 · Canvas and export.** Every screen lands on an infinite canvas with pan/zoom and artboard chrome. Refine the selected screen by describing changes, then export the project as a zip.\n\n## Plan: from a rough goal to a Markdown execution plan\n\nToggle **Plan** in Agent mode, describe what you want, and DStudio writes a **Markdown planning file** into the selected workspace. It is intentionally planning-only: no scaffolding, no hidden implementation flow. The agent turns the request into a concrete `plan.md` or `\u003ctopic\u003e-plan.md` with assumptions, milestones, tasks, risks and validation steps.\n\n**1 · You describe the outcome.** Give it a product idea, feature, workflow, migration, research task or implementation goal.\n\n**2 · It plans instead of building.** The agent makes reasonable assumptions, scopes the work and writes a Markdown file in your workspace.\n\n**3 · The file is useful immediately.** The plan includes objective, assumptions, deliverables, milestones, task breakdown, technical/design decisions, risks, validation checklist and next actions.\n\n**4 · Then you decide.** Turn Plan off and use Agent/Design to implement, or keep the Markdown file as the execution reference.\n\n## Highlights\n\n- **Local-first \u0026 private.** Everything runs on your machine. No telemetry, no cloud backend, strict CSP. The app speaks only to your local engine.\n- **Self-contained native app.** The UI is one vanilla file base64-embedded in the binary. No Electron, no asset server, no CDN.\n- **Non-invasive integration.** The agent's structured output comes from a small, **reversible, build-time patch** of the engine source: DStudio backs it up, builds a separately-named binary, and restores the original immediately. The ds4 repo stays pristine, and if the patch ever fails it falls back to the stock agent.\n- **Setup doctor.** First run checks the ds4 folder, GGUF model, chat engine, agent, design runtime, Web Search, port and LAN state, then gives a direct fix button.\n- **Pick model \u0026 reasoning per chat.** A gear in the composer collapses model selection, reasoning level, Web Search and working folder into one popover.\n- **Zero-config networking.** Localhost by default; one toggle exposes it on your Wi-Fi, and the engine still never leaves localhost (see below).\n\n## Who It's For\n\nDStudio is for local-AI builders who have the hardware to run DeepSeek V4 and want an open-source desktop workflow for private AI coding, local design generation and no-cloud app building. It is intentionally heavy: if you do not have enough RAM for the GGUF, use the screenshots and demo as the preview until your hardware catches up.\n\n## Requirements\n\nThis is a serious local AI setup. DStudio removes product friction, not physics:\n\n- **OS.** One `make` builds the branded app per platform: **DStudio.app** on **macOS** (Apple Silicon is the primary tested target), a **`dstudio`** binary on **Linux** (WebKitGTK / GTK3 via `webkit2gtk-4.1`) and a portable **Windows x64** folder/zip via `make windows`. Linux and Windows are less exercised, and `ds4` itself must be built for your platform.\n- A C compiler (`cc` / `clang`). `curl` and `tar` are used by first-run setup to download the pinned upstream `ds4` source archive; `node` is optional, only for `make check`.\n- **[antirez's ds4](https://github.com/antirez/ds4)**: DStudio installs the pinned upstream commit into `./ds4` from a GitHub source archive and applies its local patch set from `patch/`. Users do not need Git installed.\n- **A DeepSeek V4 GGUF model.** Two variants (IQ2_XXS, 2-bit):\n  - **Flash**: ~87 GB on disk, ~96-128 GB RAM\n  - **Pro**: ~430 GB on disk, ~512 GB RAM\n\n  Missing the weights? The first-run setup can download a variant and shows the size before it pulls.\n\n\u003e Not packing a 96 GB Mac? The screenshots above show every mode in action: chat, the coding agent, the design pipeline and LAN access.\n\n`ds4-design` lives in **this** repo (`extension/design/ds4_design.c`) and is compiled into the ds4 repo automatically the first time you open Design.\n\n### Windows notes\n\nFor normal use, download/extract the Windows portable zip and run `DStudio.exe`. Keep the files together: `DStudio.exe`, `ds4-server.exe`, `ds4-agent.exe`, `ds4-agent-jsonl.exe`, `ds4-agent-jsonl.ver` and `ds4-design.exe` are meant to live in the same portable folder.\n\nIf you build DStudio or use Agent/Design from a LAN client with your own local DS4 checkout, install:\n\n- **Microsoft Edge WebView2 Runtime** if your Windows install does not already have it.\n- **MSYS2 POSIX** build tools: `pacman -S make patch gcc`.\n- **Visual Studio Build Tools** or `clang-cl` for building the native Windows wrapper.\n\nThe error `msys-gcc_s-seh-1.dll was not found` means Windows found `ds4-agent-jsonl.exe` but not the MSYS2 runtime it was built with. Install MSYS2 in `C:\\msys64`; DStudio adds its runtime directories to `PATH` before launching Agent/Design. Do not copy `msys-2.0.dll` or Cygwin/MSYS DLLs next to the DS4 binaries: that can make MSYS detect the wrong root and break `/tmp`, `fork()` and shell tools. LAN Agent/Design model calls use DStudio's internal bridge, and Agent bash tools are launched through the Windows process API. First-run setup uses Windows `curl` and `tar` to download the pinned ds4 source archive; Git is not required.\n\n## Development\n\nFor local development and headless runs, keep the web server explicit:\n\n```sh\nmake run        # build + start on http://127.0.0.1:5500\nmake check      # sanity: page stays text, JS syntax OK\n```\n\nOptional parameters:\n\n```sh\nmake run PORT=8080 DS4_DIR=/path/to/ds4\n# or directly:\n./dstudio [web_port] [ds4_dir]\n```\n\nDev loop: `DS4UI_PAGE_FROM_DISK=1 ./dstudio` serves `web/index.html` from disk (hot editing) instead of the embedded copy. `DS4UI_NO_WINDOW=1` runs headless (server only).\n\n## Network (LAN)\n\nDStudio is **localhost-only by default**. To use it from a phone, tablet or another Mac on the same Wi-Fi, flip one switch in **Settings → Network access → Enable on the LAN**. The app shows the exact address to open, e.g. `http://192.168.1.207:5500`.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/README%20images/LAN/LAN%20SETTINGS.png\" height=\"340\" alt=\"Settings: enable on the LAN\"\u003e\n  \u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"assets/README%20images/LAN/telephone.jpg\" height=\"340\" alt=\"Chat over the LAN, on a phone\"\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\u003csub\u003eOne toggle in Settings (left) → open the address on your phone (right). The model streams over the network, with no app to install on the device.\u003c/sub\u003e\u003c/p\u003e\n\nBehind the scenes DStudio **reverse-proxies the engine API** (`/v1`) to the local engine, so the engine itself never leaves `127.0.0.1`: a LAN client only ever talks to DStudio, and there's **nothing to configure**.\n\n\u003e ⚠️ With the LAN enabled, anyone on the network can use the chat **and** the agent, which runs commands and edits files on this machine. Use trusted networks only, and turn it off when you're done.\n\n## How it works\n\n- **C launcher, not a script.** `dstudio.c` is both the local HTTP server and the engine supervisor: it starts/stops `ds4-server` for chat, `ds4-agent` for coding and `ds4-design` for design, manages working directories, runs the setup doctor, proxies `/v1`, serves Web Search and exposes a small local API.\n- **Native window.** `app.cc` forks the server and opens a WKWebView (macOS) / WebKitGTK (Linux) window via `webview.h`; the page is base64-embedded (`page_data.h`).\n- **Same-origin proxy.** The page calls DStudio for `/v1`; DStudio forwards streaming requests to the local engine, which is why LAN works with no engine exposure and no settings.\n\n### The agent patch: building on ds4 without forking\n\nds4's agent is a separate, fast-moving codebase that can't be modified permanently. To get **structured output** with clean tool calls, folded reasoning and KV-session slash-commands over the pipe, DStudio applies a small, **additive and fully reversible** patch at build time:\n\n1. it backs up `ds4_agent.c`,\n2. applies anchored edits for gated JSONL output and event emitters,\n3. builds a **separately-named** binary (`ds4-agent-jsonl`), reusing the existing object files,\n4. **restores the original source immediately.**\n\nThe canonical `ds4-agent` and its source are never touched; the build is idempotent (a version stamp forces a rebuild only when the patch itself changes), and it self-heals on the next launch even after a crash. If the patch ever fails to apply, for example because upstream code was reworked, DStudio **falls back to the stock `ds4-agent`** and the UI parses its raw output instead. The ds4 repo always stays pristine. (`ds4-design` is *our* code, in this repo, so it emits these events natively with no patch needed.)\n\n#### ⚠️ The patch targets antirez's **original** ds4: forks must disable it\n\nThe structured (patched) mode works against the **unmodified upstream [ds4](https://github.com/antirez/ds4)**: the patch finds its insertion points by **exact source anchors** in `ds4_agent.c`. On the original repo those anchors match and you get the full experience.\n\nIf you run a **fork of ds4** that changes the agent source, the anchors may no longer line up. The patch then refuses to apply (and DStudio auto-falls-back to the stock agent), but to skip the failing attempt entirely, **disable the patch**:\n\n\u003e **Settings → Agent output → Raw.** This runs the stock `ds4-agent` untouched and the UI parses its plain text. Lower fidelity, but it works on any ds4. (The choice is persisted, so set it once.)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/README%20images/disable-patch.png\" width=\"640\" alt=\"Settings: Agent output set to Raw (no patch)\"\u003e\n\u003c/div\u003e\n\n**Why it's done this way.** ds4 is antirez's project: fast-moving, and not the kind of repo that takes a UI's structured-output hooks upstream. So instead of forking it (which would mean maintaining a divergent copy forever) or shipping a modified binary, the integration stays **non-invasive and reversible**: it patches by anchor, builds a separate binary, and restores the source immediately. The trade-off is deliberate: the rich mode is bound to the *specific* source it was written against, and the **Raw fallback is what keeps the app working on anything else** (a fork, or a future upstream that moved the anchors). You keep the engine pristine; you opt into fidelity only where the source matches.\n\n### KV cache: how context is kept\n\nDeepSeek V4 keeps the conversation in ds4-server's **KV cache** instead of re-encoding it from scratch every turn:\n\n- **Chat** re-sends its history behind a **stable prefix**, so the server reuses the cached prefix automatically, shown as the blue *cached* token count under each reply. The KV cache is also written **to disk**, so context survives engine restarts.\n- **Agent \u0026 design** each get a **named KV session per conversation** (`\u003csha\u003e.kv`), autosaved every turn. Reopening a conversation restores its exact engine state with `/switch`, so every agent/design thread has its **own independent memory** and you can jump between them without losing context.\n\n## Security\n\n- **Localhost by default** (`DS4UI_HOST` overrides the boot host); the page is served from a fixed path: no client path ever touches the filesystem.\n- Engine spawned with `fork`+`execv` (argument array, **no shell**): no command injection. Model from a fixed enum, integer parameters range-checked, working dir passed as a single argument.\n- Mutating local APIs require the anti-CSRF header `X-Requested-With: ds4web`.\n\n\u003e ⚠️ In **agent** mode the model runs commands and edits files **autonomously** inside the chosen working directory: that directory is the security boundary, so point it at a project folder.\n\n## Roadmap\n\nWhere DStudio is headed (ideas, not promises):\n\n- **Sharper Design studio**: higher-fidelity screens, more distinct directions and faster refine loops on the canvas.\n- **Sharper Plan mode**: richer Markdown plans with better assumptions, acceptance criteria and execution clarity.\n- **Cowork**: collaborative sessions for sharing a workspace and building alongside the local model.\n- **MCP**: Model Context Protocol support so the agent can plug into external tools and data sources beyond the working directory.\n\n## Contributing\n\nDStudio is early, hardware-hungry and built for the local-AI crowd. The most useful contributions right now are setup reports, hardware reports, reproducible agent failures, design-output examples and small PRs that reduce first-run friction. If you want open-source local AI tools to exist outside cloud subscriptions, a ⭐ helps the project reach the right testers.\n\n## License\n\n[BSD 3-Clause](LICENSE) © 2026 Giuseppe Perrotta\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsk8erboi17%2Fdstudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsk8erboi17%2Fdstudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsk8erboi17%2Fdstudio/lists"}