fomext commited on
Commit
2022834
Β·
verified Β·
1 Parent(s): eacd6f4

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +4 -4
  2. entrypoint.sh +4 -4
  3. opencode.json +13 -16
Dockerfile CHANGED
@@ -2,9 +2,9 @@
2
  # - Listens on port 7860 (HF Spaces default, set in README.md app_port)
3
  # - HF Spaces enforces UID 1000 at runtime
4
  # - All state stored at /data/paperclip (HF Storage Bucket mount)
5
- # - Uses opencode_local adapter β†’ fomext OpenAI-compatible API
6
- # Β· qwen3-14b β†’ reasoning / research agents
7
- # Β· qwen3-coder-30b-a3b-instruct-fp8 β†’ coding agents
8
  #
9
  # Fix: original docker-entrypoint.sh calls `gosu` to drop rootβ†’node, which
10
  # fails on HF Spaces (already UID 1000, not root). We use our own entrypoint
@@ -31,7 +31,7 @@ USER node
31
  # PORT=7860 β†’ HF Spaces default port
32
  #
33
  # Set these in HF Space Secrets (Settings β†’ Variables and Secrets):
34
- # FOMEXT_API_KEY β€” your Fomext API key
35
  # BETTER_AUTH_SECRET β€” any long random string
36
  # PAPERCLIP_PUBLIC_URL β€” https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space
37
  # PAPERCLIP_ALLOWED_HOSTNAMES β€” YOUR_USERNAME-YOUR_SPACE_NAME.hf.space
 
2
  # - Listens on port 7860 (HF Spaces default, set in README.md app_port)
3
  # - HF Spaces enforces UID 1000 at runtime
4
  # - All state stored at /data/paperclip (HF Storage Bucket mount)
5
+ # - Uses opencode_local adapter β†’ Z.AI Coding Plan API
6
+ # Β· glm-5.2 β†’ primary model (complex tasks)
7
+ # Β· glm-4.7 β†’ small/fast model (titles, summaries, compaction)
8
  #
9
  # Fix: original docker-entrypoint.sh calls `gosu` to drop rootβ†’node, which
10
  # fails on HF Spaces (already UID 1000, not root). We use our own entrypoint
 
31
  # PORT=7860 β†’ HF Spaces default port
32
  #
33
  # Set these in HF Space Secrets (Settings β†’ Variables and Secrets):
34
+ # ZAI_API_KEY β€” your Z.AI Coding Plan API key
35
  # BETTER_AUTH_SECRET β€” any long random string
36
  # PAPERCLIP_PUBLIC_URL β€” https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space
37
  # PAPERCLIP_ALLOWED_HOSTNAMES β€” YOUR_USERNAME-YOUR_SPACE_NAME.hf.space
entrypoint.sh CHANGED
@@ -47,15 +47,15 @@ cp /app/opencode.json "${OPENCODE_CONFIG_DIR}/config.json"
47
  mkdir -p "${OPENCODE_STATE_DIR}"
48
  cat > "${OPENCODE_STATE_DIR}/auth.json" <<AUTHEOF
49
  {
50
- "fomext": {
51
  "type": "api",
52
- "key": "${FOMEXT_API_KEY}"
53
  }
54
  }
55
  AUTHEOF
56
 
57
- echo "[entrypoint] OpenCode configured β†’ fomext (https://fomext-api-router.hf.space/v1)"
58
- echo "[entrypoint] Models: qwen3-14b (reasoning) | qwen3-coder-30b-a3b-instruct-fp8 (coding)"
59
  echo "[entrypoint] Starting Paperclip..."
60
 
61
  # ── 4. Start the server ───────────────────────────────────────────────────────
 
47
  mkdir -p "${OPENCODE_STATE_DIR}"
48
  cat > "${OPENCODE_STATE_DIR}/auth.json" <<AUTHEOF
49
  {
50
+ "zai-coding-plan": {
51
  "type": "api",
52
+ "key": "${ZAI_API_KEY}"
53
  }
54
  }
55
  AUTHEOF
56
 
57
+ echo "[entrypoint] OpenCode configured β†’ Z.AI Coding Plan (https://api.z.ai/api/coding/paas/v4)"
58
+ echo "[entrypoint] Models: glm-5.2 (primary) | glm-4.7 (small/fast)"
59
  echo "[entrypoint] Starting Paperclip..."
60
 
61
  # ── 4. Start the server ───────────────────────────────────────────────────────
opencode.json CHANGED
@@ -1,30 +1,27 @@
1
  {
2
  "$schema": "https://opencode.ai/config.json",
3
  "provider": {
4
- "fomext": {
5
  "npm": "@ai-sdk/openai-compatible",
6
- "name": "Fomext",
7
  "options": {
8
- "baseURL": "https://fomext-api-router.hf.space/v1"
9
  },
10
  "models": {
11
- "qwen3-14b": {
12
- "name": "Qwen3 14B (reasoning/research)"
13
  },
14
- "qwen3-coder-30b-a3b-instruct-fp8": {
15
- "name": "Qwen3 Coder 30B (coding)"
16
- },
17
- "qwen3-30b-a3b": {
18
- "name": "Qwen3 30B"
19
  }
20
  }
21
  }
22
  },
23
- "model": "fomext/qwen3-30b-a3b",
24
- "small_model": "fomext/qwen3-14b",
25
  "agent": {
26
- "title": { "model": "fomext/qwen3-14b" },
27
- "summary": { "model": "fomext/qwen3-14b" },
28
- "compaction": { "model": "fomext/qwen3-14b" }
29
  }
30
- }
 
1
  {
2
  "$schema": "https://opencode.ai/config.json",
3
  "provider": {
4
+ "zai-coding-plan": {
5
  "npm": "@ai-sdk/openai-compatible",
6
+ "name": "Z.AI Coding Plan",
7
  "options": {
8
+ "baseURL": "https://api.z.ai/api/coding/paas/v4"
9
  },
10
  "models": {
11
+ "glm-5.2": {
12
+ "name": "GLM-5.2"
13
  },
14
+ "glm-4.7": {
15
+ "name": "GLM-4.7"
 
 
 
16
  }
17
  }
18
  }
19
  },
20
+ "model": "zai-coding-plan/glm-5.2",
21
+ "small_model": "zai-coding-plan/glm-4.7",
22
  "agent": {
23
+ "title": { "model": "zai-coding-plan/glm-4.7" },
24
+ "summary": { "model": "zai-coding-plan/glm-4.7" },
25
+ "compaction": { "model": "zai-coding-plan/glm-4.7" }
26
  }
27
+ }