@dncore/synapse 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -13
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,23 +1,76 @@
|
|
|
1
1
|
# @dncore/synapse (npm distribution)
|
|
2
2
|
|
|
3
3
|
The synapse protocol adapter distributed as prebuilt native binaries —
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Node.js is only the launcher; the daemon is the original Go binary
|
|
5
|
+
(esbuild-style distribution, zero JS dependencies).
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
npm install -g @dncore/synapse
|
|
9
|
-
synapse
|
|
10
|
+
npm install -g @dncore/synapse # npm >= 7 (platform package is an optionalDependency)
|
|
11
|
+
synapse init # writes the annotated ~/.config/synapse/config.yaml
|
|
12
|
+
$EDITOR ~/.config/synapse/config.yaml # set upstream.base_url at minimum
|
|
13
|
+
synapse service install --now # autostart service, started immediately
|
|
14
|
+
synapse status
|
|
10
15
|
```
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
Point any Responses-API client (e.g. Codex) at `http://127.0.0.1:8787/v1`.
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
| Command | What it does |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `synapse init [--config P]` | Write the self-documenting default config (refuses to overwrite) |
|
|
24
|
+
| `synapse start / stop / restart` | Control the installed service (graceful drain on stop) |
|
|
25
|
+
| `synapse status [--config P]` | One screen: service state, unit/config paths, listen, upstream, live `/health` `/ready` `/version` probes |
|
|
26
|
+
| `synapse service install [--config P] [--now]` | Generate the unit file with the **resolved binary path** (works from any npm prefix), enable boot autostart |
|
|
27
|
+
| `synapse service uninstall` | Stop, disable autostart, remove the unit — **keeps** your config |
|
|
28
|
+
| `synapse check-config [--config P]` | Validate config and print the effective values |
|
|
29
|
+
| `synapse healthcheck [--url U]` | One-shot health probe (used by the Docker image) |
|
|
30
|
+
| `synapse [--config P]` | Run in the foreground (Ctrl-C drains gracefully) |
|
|
31
|
+
| `synapse --version` / `--help` | Version / full command surface |
|
|
32
|
+
|
|
33
|
+
## Where things live
|
|
34
|
+
|
|
35
|
+
| Platform | Service | Unit file | Config | Logs |
|
|
36
|
+
|---|---|---|---|---|
|
|
37
|
+
| Linux | systemd **user** unit | `~/.config/systemd/user/synapse.service` | `~/.config/synapse/config.yaml` | `journalctl --user -u synapse -f` |
|
|
38
|
+
| macOS | launchd agent | `~/Library/LaunchAgents/com.synapse.proxy.plist` | `~/.config/synapse/config.yaml` | `~/Library/Logs/synapse.log` |
|
|
39
|
+
|
|
40
|
+
On Linux, `service install` also runs `loginctl enable-linger` so the
|
|
41
|
+
daemon starts at boot without anyone logged in.
|
|
42
|
+
|
|
43
|
+
## Configuration
|
|
44
|
+
|
|
45
|
+
`synapse init` writes a fully commented config; the one setting you must
|
|
46
|
+
set is `upstream.base_url` (your OpenAI-compatible chat-completions
|
|
47
|
+
provider). Every value can instead be overridden with `PROXY_*`
|
|
48
|
+
environment variables (`PROXY_UPSTREAM_BASE_URL`,
|
|
49
|
+
`PROXY_SERVER_LISTEN`, … — the full list is in the generated file).
|
|
50
|
+
The proxy stores no credentials: client `Authorization` headers are
|
|
51
|
+
forwarded verbatim.
|
|
52
|
+
|
|
53
|
+
After editing the config, apply it with `synapse restart` (drains
|
|
54
|
+
in-flight streams first).
|
|
55
|
+
|
|
56
|
+
## Troubleshooting
|
|
18
57
|
|
|
19
|
-
|
|
20
|
-
|
|
58
|
+
- **`start failed … service not loaded`** — the service is not
|
|
59
|
+
installed: `synapse service install --now` first, or run bare with
|
|
60
|
+
`synapse --config <path>`.
|
|
61
|
+
- **Port already in use** — another process owns `server.listen`
|
|
62
|
+
(default `0.0.0.0:8787`); change it in the config and
|
|
63
|
+
`synapse restart`. `synapse status` shows what the service actually
|
|
64
|
+
listens on.
|
|
65
|
+
- **Upstream unreachable through a system proxy** — set `NO_PROXY`
|
|
66
|
+
(or unset `http_proxy`/`https_proxy`) in the unit's environment if
|
|
67
|
+
your upstream is local.
|
|
68
|
+
- **Logs** — Linux: `journalctl --user -u synapse -f` (structured
|
|
69
|
+
JSON); macOS: `tail -f ~/Library/Logs/synapse.log`.
|
|
70
|
+
- **Platform package missing** — npm skipped optional dependencies
|
|
71
|
+
(`--no-optional` / `--omit=optional`); reinstall without those flags,
|
|
72
|
+
or point `SYNAPSE_BINARY` at a binary you installed yourself.
|
|
21
73
|
|
|
22
74
|
See the [repo README](https://github.com/dncore/synapse-protocol-adapter)
|
|
23
|
-
for
|
|
75
|
+
for protocol semantics, Docker deployment, performance numbers, and the
|
|
76
|
+
security model.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dncore/synapse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Stateless, high-concurrency OpenAI Responses API to Chat Completions protocol adapter (prebuilt Go binary)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@dncore/synapse-linux-x64": "0.
|
|
19
|
-
"@dncore/synapse-linux-arm64": "0.
|
|
20
|
-
"@dncore/synapse-darwin-x64": "0.
|
|
21
|
-
"@dncore/synapse-darwin-arm64": "0.
|
|
18
|
+
"@dncore/synapse-linux-x64": "0.2.1",
|
|
19
|
+
"@dncore/synapse-linux-arm64": "0.2.1",
|
|
20
|
+
"@dncore/synapse-darwin-x64": "0.2.1",
|
|
21
|
+
"@dncore/synapse-darwin-arm64": "0.2.1"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
24
|
"node": ">=16"
|