68 lines
3.2 KiB
Markdown
68 lines
3.2 KiB
Markdown
# DS4Server
|
|
|
|
DS4Server is a native macOS application for running DwarfStar models as a local
|
|
coding agent and as a localhost inference server. The inference engine, model
|
|
lifecycle, agent loop, and application UI are implemented in Rust with Iced;
|
|
the Metal kernels and small native integration layers are adapted from
|
|
[DwarfStar (`ds4`)](https://github.com/antirez/ds4).
|
|
|
|
## Capabilities
|
|
|
|
- **Project-based coding chat.** Add local project folders, keep multiple
|
|
persistent sessions per project, and rename, retitle, pin, archive, compact,
|
|
rebuild, or delete sessions. Chats stream Markdown, reasoning, tool activity,
|
|
context use, and generation speed.
|
|
- **Local coding tools.** The agent can read, search, list, write, and edit
|
|
project files; run and monitor asynchronous shell commands; search Google;
|
|
and visit rendered web pages. File access is confined to the project, output
|
|
is bounded, and risky shell or visible-browser actions require approval.
|
|
- **Long-running sessions.** Transcripts and summaries are stored in SQLite.
|
|
Automatic and manual context compaction preserve the complete visible chat,
|
|
while durable KV checkpoints make follow-up turns and relaunches resumable.
|
|
- **Native Metal inference.** DeepSeek V4 Flash, DeepSeek V4 Pro, and GLM 5.2
|
|
run through model-specific Rust/Metal executors with long-context prefill,
|
|
sampling, cancellation, idle unload, and a bounded resident session pool.
|
|
Supported acceleration includes SSD expert streaming, DeepSeek legacy MTP,
|
|
DSpark, GLM MTP, directional steering, and model-specific memory admission.
|
|
- **Local HTTP APIs.** A configurable listener on `127.0.0.1:4000` exposes
|
|
Models, Chat Completions, Completions, Anthropic Messages, and Responses APIs
|
|
with streaming, tool calls, usage accounting, cancellation, and prefix-aware
|
|
KV reuse. Endpoint conversations remain client-owned and are not added to
|
|
project history.
|
|
- **Model and runtime management.** Model Manager downloads, resumes, verifies,
|
|
and deletes supported GGUF artifacts with byte progress, speed, and ETA.
|
|
Preferences cover generation, runtime, SSD, speculative decoding, steering,
|
|
KV storage, the local endpoint, and idle unload. The Stats view reports model,
|
|
cache, SSD, speculative, session, and HTTP activity.
|
|
|
|
Projects, sessions, and transcripts use SQLite. Settings use a compact YAML file
|
|
that contains only values changed from their defaults and can also be edited by
|
|
hand.
|
|
|
|
## Build and run
|
|
|
|
DS4Server targets macOS 13 or newer and requires Rust 1.97 plus
|
|
`cargo-packager` 0.11.8.
|
|
|
|
```sh
|
|
cargo install cargo-packager --locked --version 0.11.8
|
|
make bundle
|
|
open target/release/DS4Server.app
|
|
```
|
|
|
|
## Application data
|
|
|
|
```text
|
|
~/Library/Application Support/DS4Server.rfc1437.de/data.sqlite3
|
|
~/Library/Application Support/DS4Server.rfc1437.de/config.yaml
|
|
~/Library/Application Support/DS4Server.rfc1437.de/kv-cache/
|
|
```
|
|
|
|
Deleting a project or session removes DS4Server metadata and its associated
|
|
checkpoint; it never deletes the referenced project directory. See
|
|
[PLAN.md](PLAN.md) for the remaining implementation work.
|
|
|
|
The adapted Metal and browser sources retain their upstream notices in
|
|
[`native/metal/LICENSE`](native/metal/LICENSE) and
|
|
[`native/web/LICENSE`](native/web/LICENSE).
|