---
title: Notes on trying ds4 (DwarfStar 4) on ASUS Ascent GX10 (DGX Spark)
summary: This article introduces ds4 (DwarfStar 4), which now supports DGX Spark. It explains installation, compilation, running as an OpenAI/Anthropic-compatible server, registering as a systemd service, and connecting from Claude Code.
tags: ["ds4", "DeepSeek V4 Flash", "DGX Spark", "ASUS Ascent GX10", "CUDA", "NVIDIA"]
categories: ["HomeLab", "DGXSpark"]
date: 2026-05-12T02:16:16.776Z
updated: 2026-09-14T14:07:20.222Z
---

I'll try [ds4 (DwarfStar 4)](https://github.com/antirez/ds4) on a single DGX Spark.

https://github.com/antirez/ds4/blob/main/docs/DGX_SPARK.md

### Installing ds4

Place the source code etc. in `/opt/ds4`.

```bash
sudo mkdir -p /opt/ds4
sudo chown -R $USER:$USER /opt/ds4
```

Clone with git.

```bash
git clone https://github.com/antirez/ds4.git .
```

Verified at the following revision.

```bash
$ git rev-parse --short HEAD
a04f46f
```

Download the model.

```bash
./download_model.sh ds4f-q2
```

Compile for DGX Spark.

```bash
make cuda-spark 
```

### Verifying operation

First, try a one-shot prompt.

```bash
./ds4 --cuda -p "Explain Spring Boot in one paragraph."
```

The output looks like this.

![image](https://s3.ik.am/ikam/_/1789371892469_pasted-image.png)


### Starting the OpenAI/Anthropic-compatible server

Next, start it as a server. This server implements the OpenAI/Anthropic API and can also be accessed from coding agents.

```bash
./ds4-server --cuda --ctx 262144 --kv-disk-dir /tmp/ds4-kv --kv-disk-space-mb 8192 --host 0.0.0.0 --port 8888
```

First, try accessing `/v1/models`.

```bash
$ curl localhost:8888/v1/models -s | jq .
{
  "object": "list",
  "data": [
    {
      "id": "deepseek-v4-flash",
      "object": "model",
      "created": 1767225600,
      "owned_by": "ds4.c",
      "name": "DeepSeek V4 Flash",
      "context_length": 262144,
      "top_provider": {
        "context_length": 262144,
        "max_completion_tokens": 262144,
        "is_moderated": false
      },
      "supported_parameters": [
        "tools",
        "tool_choice",
        "max_tokens",
        "temperature",
        "top_p",
        "top_k",
        "min_p",
        "ignore_eos",
        "stop",
        "seed",
        "stream",
        "reasoning_effort"
      ]
    },
    {
      "id": "deepseek-v4-pro",
      "object": "model",
      "created": 1767225600,
      "owned_by": "ds4.c",
      "name": "DeepSeek V4 Flash",
      "context_length": 262144,
      "top_provider": {
        "context_length": 262144,
        "max_completion_tokens": 262144,
        "is_moderated": false
      },
      "supported_parameters": [
        "tools",
        "tool_choice",
        "max_tokens",
        "temperature",
        "top_p",
        "top_k",
        "min_p",
        "ignore_eos",
        "stop",
        "seed",
        "stream",
        "reasoning_effort"
      ]
    }
  ]
}
```

Try `/v1/chat/completions`.

```bash
curl http://localhost:8888/v1/chat/completions --json '{
    "messages": [
      {"role": "user", "content": "Who are you?"}
    ]
  }' -s | jq .
```

The following response is returned.

```json
{
  "id": "chatcmpl-cb9c3df1fb053c162c10afcb",
  "object": "chat.completion",
  "created": 1789372875,
  "model": "deepseek-v4-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hi there! I'm DeepSeek, an AI assistant created by the DeepSeek company (深度求索). I'm here to help you with questions, tasks, or anything you need assistance with!\n\nHere are a few things about me:\n\n- **I'm free to use** – no subscriptions or fees required\n- **I support large contexts** – up to 1M tokens, so I can handle very long conversations or documents\n- **I can read files** – I accept text, PDFs, Word documents, Excel files, and even images (extracting text from them)\n- **I have web search capabilities** – you can enable it manually if you need up-to-date information\n- **My knowledge cutoff** is May 2025, and I'm available on both web and mobile apps (which support voice input)\n\nIf you need to use web search, just make sure to turn it on in the app or website—I can't automatically access the internet unless you enable that feature.\n\nSo, what can I help you with today? 😊",
        "reasoning_content": "1.  **Analyze the User's Request**: The user asks \"Who are you?\" This is a simple identity question.\n2.  **Identify the Core Identity**: I am DeepSeek, an AI assistant created by the DeepSeek company (深度求索).\n3.  **Formulate the Response**:\n    *   State my name clearly.\n    *   Mention my creator (DeepSeek company).\n    *   Highlight key features/characteristics to give a complete picture (capability, knowledge cutoff, free, context length, file support, search capability, voice input).\n    *   Ensure the tone is friendly and helpful.\n4.  **Draft the content**:\n    *   Name: DeepSeek.\n    *   Creator: DeepSeek company (深度求索).\n    *   Key facts: Knowledge cutoff May 2025, text-based, free, 1M context, supports text and image uploads, web search optional, voice input on apps.\n    *   Tone: Enthusiastic and welcoming.\n5.  **Review against constraints**: No constraints mentioned. Keep it concise but informative."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "completion_tokens": 452,
    "total_tokens": 460,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 8
    }
  }
}
```

The following logs are output on the server side.

```
0914 17:00:51 ds4-server: chat ctx=0..8:8 prompt start
ds4: routed MoE using aligned CUDA artifacts
0914 17:00:52 ds4-server: chat ctx=0..8:8 prompt done 0.578s
0914 17:00:54 ds4-server: chat ctx=8..58:50 gen=50 THINKING decoding chunk=19.01 t/s avg=19.01 t/s 2.630s
0914 17:00:57 ds4-server: chat ctx=58..108:50 gen=100 THINKING decoding chunk=19.65 t/s avg=19.32 t/s 5.175s
0914 17:00:59 ds4-server: chat ctx=108..158:50 gen=150 THINKING decoding chunk=19.58 t/s avg=19.41 t/s 7.728s
0914 17:01:02 ds4-server: chat ctx=158..208:50 gen=200 THINKING decoding chunk=19.46 t/s avg=19.42 t/s 10.297s
0914 17:01:04 ds4-server: chat ctx=208..258:50 gen=250 decoding chunk=19.57 t/s avg=19.45 t/s 12.852s
0914 17:01:07 ds4-server: chat ctx=258..308:50 gen=300 decoding chunk=19.53 t/s avg=19.46 t/s 15.413s
0914 17:01:10 ds4-server: chat ctx=308..358:50 gen=350 decoding chunk=19.53 t/s avg=19.47 t/s 17.972s
0914 17:01:12 ds4-server: chat ctx=358..408:50 gen=400 decoding chunk=19.41 t/s avg=19.47 t/s 20.548s
0914 17:01:15 ds4-server: chat ctx=408..458:50 gen=450 decoding chunk=19.51 t/s avg=19.47 t/s 23.111s
0914 17:01:15 ds4-server: chat ctx=458..460:2 gen=452 decoding chunk=19.49 t/s avg=19.47 t/s 23.213s
0914 17:01:15 ds4-server: thinking live checkpoint remembered ctx=0..8:8 live=460 visible=1011
0914 17:01:15 ds4-server: chat ctx=0..8:8 gen=452 finish=stop 23.791s
```


Setting `reasoning_effort` to `none` turns thinking off.

```bash
curl http://localhost:8888/v1/chat/completions --json '{
    "messages": [
      {"role": "user", "content": "Who are you?"}
    ],
    "reasoning_effort": "none"
  }' -s | jq .
```

The following response is returned.

```json
{
  "id": "chatcmpl-922a99e59ad9f3d484fe34cb",
  "object": "chat.completion",
  "created": 1789373411,
  "model": "deepseek-v4-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm DeepSeek, an AI assistant created by the company DeepSeek (深度求索). I'm here to help you with a wide range of tasks—whether it's answering questions, solving problems, providing explanations, or just having a friendly conversation.\n\nI'm a text-based AI model, which means I process and generate text. I can't see images, but I can read text from uploaded files (like PDFs, Word docs, Excel sheets, etc.) and help you work with that content.\n\nSome key things about me:\n- **Knowledge**: My training data goes up to May 2025, so I'm quite up-to-date.\n- **Capabilities**: I can handle conversations, coding, writing, analysis, and more. I support both Chinese and English, plus other languages.\n- **Features**: I have a 1M token context window, which means I can process very large amounts of text at once—like an entire trilogy of novels! I also support file uploads and can search the web if you enable that feature (though you'll need to manually turn on the search button in the interface).\n\nIf you'd like to know more about me or how I work, feel free to ask! What can I help you with today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "completion_tokens": 258,
    "total_tokens": 266,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 8
    }
  }
}
```


### Registering as a systemd service

Run the server as a persistent systemd service.

```bash
cat <<EOF | sudo tee /etc/systemd/system/ds4-server.service > /dev/null
[Unit]
Description=DwarfStar 4 Server
Documentation=https://github.com/antirez/ds4
After=network-online.target
Wants=network-online.target

[Service]
User=$USER
Group=$USER
Type=simple
ExecStart=/opt/ds4/ds4-server --model /opt/ds4/ds4flash.gguf --ctx 262144 --kv-disk-dir /tmp/ds4-kv --kv-disk-space-mb 8192 --host 0.0.0.0 --port 8888

Restart=on-failure
RestartSec=30s
StartLimitInterval=300
StartLimitBurst=5

[Install]
WantedBy=multi-user.target
EOF
```

```bash
sudo systemctl daemon-reload
sudo systemctl enable ds4-server
sudo systemctl start ds4-server
sudo systemctl status ds4-server
```

### Accessing from Claude Code

Install Claude Code in a clean environment.

```bash
curl -fsSL https://claude.ai/install.sh | bash
export PATH="$HOME/.local/bin:$PATH"
```

Tried with the following version.

```bash
$ claude --version
2.1.263 (Claude Code)
```

Prepare the following script that wraps the `claude` command.

```bash
cat <<'EOF' > ~/cc-ds4.sh
#!/bin/bash
unset ANTHROPIC_API_KEY

export ANTHROPIC_BASE_URL="${DS4_ANTHROPIC_BASE_URL:-http://<DGX SparkのIPアドレス>:8888}"
export ANTHROPIC_AUTH_TOKEN="${DS4_API_KEY:-dsv4-local}"
export ANTHROPIC_MODEL="deepseek-v4-flash[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL=$ANTHROPIC_MODEL
export ANTHROPIC_DEFAULT_HAIKU_MODEL=$ANTHROPIC_MODEL
export ANTHROPIC_DEFAULT_OPUS_MODEL=$ANTHROPIC_MODEL
export CLAUDE_CODE_SUBAGENT_MODEL=$ANTHROPIC_MODEL
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
export CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1
export CLAUDE_STREAM_IDLE_TIMEOUT_MS=600000
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=250000
export CLAUDE_CODE_EFFORT_LEVEL=low
echo "Model: $ANTHROPIC_MODEL"
set -ex
claude --dangerously-skip-permissions $@
EOF
chmod +x ~/cc-ds4.sh
```

Create a working directory,

```bash
mkdir -p hello
cd hello
```

Run Claude Code.

```bash
~/cc-ds4.sh
```

It works normally.

![image](https://s3.ik.am/ikam/_/1789374419329_pasted-image.png)



### Accessing from OpenCode

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ds4": {
      "name": "DwarfStar",
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://<DGX SparkのIPアドレス>:8888/v1",
        "apiKey": "dsv4-local"
      },
      "models": {
        "deepseek-v4-flash": {
          "name": "DwarfStar Flash",
          "limit": {
            "context": 262144,
            "output": 262144
          },
          "options": {
            "reasoningEffort": "low"
          }
        }
      }
    }
  }
}

```

Confirmed with the following version.

```bash
$ opencode --version
1.18.30
```


```bash
opencode --model ds4/deepseek-v4-flash --auto
```

![image](https://s3.ik.am/ikam/_/1789374568673_pasted-image.png)
