phosphor-harness 0.0.0-stage → 0.4.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/LICENSE +201 -0
- package/README.md +134 -2
- package/bin/phosphor.cjs +24 -0
- package/ornith-profile.example.json +7 -0
- package/package.json +16 -4
- package/profile.example.json +11 -0
- package/pyproject.toml +15 -0
- package/quickstart.sh +310 -0
- package/requirements-orin-voice.txt +16 -0
- package/scripts/fetch_ornith_weights.py +40 -0
- package/scripts/fetch_phosphor.py +50 -0
- package/scripts/fetch_sources.py +45 -0
- package/scripts/phosphor-weights.sha256 +11 -0
- package/scripts/run_service.sh +75 -0
- package/sophon_harness/__init__.py +1 -0
- package/sophon_harness/cli.py +76 -0
- package/sophon_harness/news.py +96 -0
- package/sophon_harness/ornith.py +377 -0
- package/sophon_harness/playback_rearm.py +21 -0
- package/sophon_harness/portal_server.py +229 -0
- package/sophon_harness/talker.py +57 -0
- package/sophon_harness/terminal_input.py +124 -0
- package/sophon_harness/tools.py +288 -0
- package/sophon_harness/voice.py +371 -0
- package/sources.lock.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Robit
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,135 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Phosphor Harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Linux microphone and speaker harness with interchangeable Ornith 1.5 9B and native acoustic Qwen 4B backplanes and the original Sophon streaming Talker. Qwen Omni Adapters executes structured tool calls through its authenticated tool API in a separate CPU process. The harness owns tool-result reinjection, conversation history, and speech playback.
|
|
4
|
+
|
|
5
|
+
## Quickstart
|
|
6
|
+
|
|
7
|
+
Run this in your Linux desktop session. Phosphor detects the GPU and system audio devices, installs the runtime, downloads and verifies the roughly 12 GB [Phosphor weight bundle](https://huggingface.co/cudabenchmarktest/Phosphor), and starts a user service. Speak when the command says it is listening.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx --yes phosphor-harness
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a persistent CLI, run `npm install -g phosphor-harness` and then `phosphor`. From a source checkout, use `./quickstart.sh`. The normal install starts the service on login. Check it with `phosphor status`, follow activity with `phosphor logs`, or stop it and disable startup with `phosphor stop`.
|
|
14
|
+
|
|
15
|
+
Automatic setup targets Ubuntu/Debian with a PulseAudio-compatible user session and a working NVIDIA driver. It requires a supported Ampere-or-newer GPU with at least 16 GB of VRAM, or an Orin with at least 24 GB of unified memory. Fresh devices may ask for the OS password to install missing system packages. Model inference requires CUDA. Tool execution runs with the desktop user's permissions. Keep the runtime in an account suitable for the tools you enable.
|
|
16
|
+
|
|
17
|
+
Use `phosphor --doctor` to see detected hardware. Supply explicit settings with `--manual`. For example:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
phosphor --manual --microphone alsa_input.example --speaker alsa_output.example --channels 6
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`--prepare-only` downloads and checks the runtime without starting its service. `--manual --help` lists supported overrides, including existing weights, CUDA Python, the native server, individual camera devices, and context size. The service uses loopback ports 18213–18215. On a GPU-broker host it requests a lease for just the selected GPU.
|
|
24
|
+
|
|
25
|
+
## Capabilities
|
|
26
|
+
|
|
27
|
+
The pinned adapter exposes 47 tools in 20 families. The harness adds a headlines tool. The model starts with clock, approximate current location, system information, arithmetic, session memory, web access, and typed tool discovery. Discovery makes the complete catalog available by family and retains each selected family's exact schemas throughout the turn. The catalog includes shell execution, dedicated terminal sessions, workspace files, web, documents, notes and tasks, MCP, file delivery, browser, desktop, camera, and peripheral tools.
|
|
28
|
+
|
|
29
|
+
The harness preserves typed argument validation, native tool-result messages, and tool execution after the microphone turn commits. The tool server executes under the service user account, listens on loopback, and stores its bearer token in a private file.
|
|
30
|
+
|
|
31
|
+
Both profiles accept microphone audio. Ornith also accepts an operator-selected JPEG or PNG alongside the spoken request. Ask Phosphor to look to capture a still from the locally available cameras and inspect it with the visual projector. The camera stays idle during unrelated turns. Device discovery can list serial, USB, Bluetooth, and network hardware and pass exact device identifiers into the device tools. Desktop tools, configured connectors, archives, and background workers use the services available in the current session.
|
|
32
|
+
|
|
33
|
+
## Prepare the shared runtime
|
|
34
|
+
|
|
35
|
+
The source and weight pins are in [sources.lock.json](sources.lock.json). Install PyTorch for the target CUDA platform and keep the adapter tool environment separate from the model environment. On Orin, use the NVIDIA build matched to JetPack.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python3 scripts/fetch_sources.py runtime/sources
|
|
39
|
+
python3 -m venv runtime/tools-venv
|
|
40
|
+
runtime/tools-venv/bin/pip install ./runtime/sources/qwen_omni_adapters .
|
|
41
|
+
mkdir -p runtime/state/workspace
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Start the tool API in the tool environment.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
runtime/tools-venv/bin/python -m sophon_harness.portal_server \
|
|
48
|
+
--adapters runtime/sources/qwen_omni_adapters \
|
|
49
|
+
--state runtime/state --workspace runtime/state/workspace --camera
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
In a CUDA-enabled model environment, install this repository and the inference dependencies. The evaluated Orin package versions are in [requirements-orin-voice.txt](requirements-orin-voice.txt). Install the original Sophon engine dependencies in the Talker environment. The microphone runner uses PulseAudio-compatible `parec` and `pacat`, NumPy, SciPy, SoundFile, ONNX Runtime, Transformers, and the Fine-Tuning Suite acoustic loader. The Orin deployment exercised Transformers 4.57.6 and NVIDIA PyTorch 2.4.0a0 for the 4B model. The Talker may need its own Transformers and torchaudio environment.
|
|
53
|
+
|
|
54
|
+
## Run Ornith 1.5 9B with Sophon speech
|
|
55
|
+
|
|
56
|
+
Ornith uses the published Q4_K_M language weights and combined BF16 projector. The same loaded 9B model first transcribes committed audio with the trained projector, then responds to the transcript or emits native structured calls. Only visible assistant text reaches the original Sophon Talker. The 9B profile inherits the same tool catalog and six-turn history.
|
|
57
|
+
|
|
58
|
+
Download the pinned weights and verify their sizes and SHA-256 digests. The script fetches the Ornith model, its projector, and the original Sophon speech assets.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python -m pip install huggingface-hub==0.36.0
|
|
62
|
+
python scripts/fetch_ornith_weights.py runtime/weights
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Build the pinned llama.cpp server with the Qwen Omni Adapters build script. It applies the tested JSON schema patches and sets the CUDA architecture and allocator options for Jetson. Start the model processes under the host's GPU allocation.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bash runtime/sources/qwen_omni_adapters/scripts/build_llama_cpp.sh "$(realpath runtime/sources/llama_cpp)"
|
|
69
|
+
runtime/sources/llama_cpp/build/bin/llama-server \
|
|
70
|
+
--model runtime/weights/ornith_weights/ornith-1.5-9b-q4_k_m.gguf \
|
|
71
|
+
--mmproj runtime/weights/ornith_weights/mmproj-ornith15-omni-audio-bridge-bf16.gguf \
|
|
72
|
+
--alias ornith-1.5-9b --host 127.0.0.1 --port 18215 --no-webui --jinja \
|
|
73
|
+
--cors-origins http://127.0.0.1:18215 --no-cors-credentials \
|
|
74
|
+
--reasoning-format deepseek --device CUDA0 --mmproj-device CUDA0 --gpu-layers 99 \
|
|
75
|
+
--fit off --ctx-size 8192 --parallel 1 --cache-type-k q8_0 --cache-type-v q8_0 --flash-attn on
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
In a separate terminal and the Talker environment, start the original speech worker. Add `--orin` on Jetson Orin. To use a compatible private voice profile, supply a separate speech layout containing that profile under `voices/`.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
python -m sophon_harness.talker \
|
|
82
|
+
--source runtime/sources/sophon_realtime \
|
|
83
|
+
--speech-weights runtime/weights/sophon_speech
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Start the microphone client using [ornith-profile.example.json](ornith-profile.example.json). Choose the channel count for your hardware. The Egg's ReSpeaker uses channel 0 of a six-channel input.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
sophon-harness --token-file runtime/state/portal.token \
|
|
90
|
+
voice --suite runtime/sources/fine_tuning_suite --profile ornith-profile.example.json \
|
|
91
|
+
--ornith-url http://127.0.0.1:18215 \
|
|
92
|
+
--vad runtime/sources/sophon_realtime/e2e/config/silero_vad.onnx --channels 6
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Run the native Qwen 4B profile
|
|
96
|
+
|
|
97
|
+
The tested Qwen 4B acoustic bundle is `qwen4b-sophon-native-midpoint-cac37de`, supplied by the operator. It contains the Qwen3 weights, Omni donor projector, and trained connector. Start the original Talker as above and copy [profile.example.json](profile.example.json) beside the local acoustic bundle. Set the paths in your copy.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
sophon-harness --token-file runtime/state/portal.token \
|
|
101
|
+
voice --suite runtime/sources/fine_tuning_suite --profile /path/to/profile.json \
|
|
102
|
+
--vad runtime/sources/sophon_realtime/e2e/config/silero_vad.onnx \
|
|
103
|
+
--memory-mib 16384 --orin --channels 6
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Speak into the microphone and pause for a response. Capture rearms after a short quiet interval following playback to reject the speaker's tail. Add `--probe /path/to/input.wav --probe-only` for an offline audio replay. Repeat `--probe` with `--probe-history` to replay a multi-turn conversation.
|
|
107
|
+
|
|
108
|
+
With the 9B profile, add `--image /path/to/image.png` to attach the current contents of a JPEG or PNG file at commit. The vision projector receives the image pixels alongside the transcribed request. The backplane carries the resulting visual evidence through that turn's structured tool calls. Keep the image at or below 8 MiB.
|
|
109
|
+
|
|
110
|
+
## Inspect and use tools
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
sophon-harness --token-file runtime/state/portal.token tools
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The tool server can enable local cameras with `--camera`. The automatic setup enables on-demand camera capture. Use `--manual --no-camera` to disable it, or specify each permitted `--camera-device`. Exact tools receive permissions from the current OS account and session. If a dedicated terminal is at an echo-disabled password prompt, the harness can request the credential aloud. Say “password is” followed by the credential, spell its characters, or say cancel. Spoken recognition can mishear characters. Use the original terminal when exact entry is required.
|
|
117
|
+
|
|
118
|
+
Use `attach /path/to/document.pdf` with the same CLI options to index an operator-selected document in the current voice session. Attach an audio or video file the same way to use the adapter's media inspection tools. These tools report observed media metadata. Native image input uses `voice --image`.
|
|
119
|
+
|
|
120
|
+
Use `location --file /path/to/location.json` with the same CLI options to provide approximate location to the current session. A location object can contain a city, region, and country. Use `location --clear` to remove it. The tool reports unavailable when the session has no location.
|
|
121
|
+
|
|
122
|
+
Tool failures retain the executor's reason, exit code, or approved alternatives. The model can correct invalid arguments or choose an indicated capability. A transient read can repeat the exact request once. A rejected schema is repaired before dispatch.
|
|
123
|
+
|
|
124
|
+
The voice profile accepts `tool_timeout_s` for longer calls. A transport timeout may leave the outcome unknown, so verify command effects before requesting another execution.
|
|
125
|
+
|
|
126
|
+
## Verification on Jetson AGX Orin
|
|
127
|
+
|
|
128
|
+
- Ornith 9B answered six of seven recorded conversation turns correctly. It called the clock and calculator, returned 56 for eight times seven, and repeated a phrase only when asked to do so in this replay. It gave a wrong answer to the cow question. The earlier 4B replay answered two of the seven correctly and used a generation-only harness.
|
|
129
|
+
- The separate spoken news replay called the headlines tool and produced a spoken answer. The documents replay discovered the typed search tool and reported the empty result. These tests exercised four paths through the 48-schema catalog. Other tools may require their own service setup and validation.
|
|
130
|
+
- First non-silent PCM for the seven 9B replays ranged from 5.561 to 8.627 seconds after turn commit, with a median of 5.789 seconds. The live device uses the ReSpeaker microphone and its configured speaker output with the operator's existing voice profile.
|
|
131
|
+
- The runtime captures a committed audio turn, runs the acoustic bridge, and then sends the transcript through Ornith's native chat template. This profile is turn-based. The microphone rearms after playback completes, so verbal barge-in is unavailable. Its 9B audio bridge results are separate from the original Sophon's full-duplex benchmark.
|
|
132
|
+
|
|
133
|
+
## Source and attribution
|
|
134
|
+
|
|
135
|
+
The tool API and catalog come from Qwen Omni Adapters. The committed-turn runtime and the Ornith audio bridge come from Fine-Tuning Suite. [Ornith 1.5 9B](https://huggingface.co/ornith-ai/Ornith-1.5-9B) is MIT-licensed. Its [published GGUF artifacts](https://huggingface.co/cudabenchmarktest/Ornith-1.5-9B-Omni-Audio-Bridge-GGUF) include Apache-2.0 components from Qwen3-Omni. The Talker, decoder, and vocoder come from [Sophon Realtime 4B E2E](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-E2E) under Apache-2.0. Operator checkpoints, cloned voice profiles, credentials, and recorded conversations live outside this repository.
|
package/bin/phosphor.cjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawn } = require("node:child_process");
|
|
5
|
+
const { join } = require("node:path");
|
|
6
|
+
|
|
7
|
+
const child = spawn("bash", [join(__dirname, "..", "quickstart.sh"), ...process.argv.slice(2)], {
|
|
8
|
+
stdio: "inherit",
|
|
9
|
+
});
|
|
10
|
+
child.on("error", (error) => {
|
|
11
|
+
console.error(`Phosphor could not start setup: ${error.message}`);
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
});
|
|
14
|
+
const handlers = new Map();
|
|
15
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
16
|
+
const relay = () => child.kill(signal);
|
|
17
|
+
handlers.set(signal, relay);
|
|
18
|
+
process.on(signal, relay);
|
|
19
|
+
}
|
|
20
|
+
child.on("exit", (code, signal) => {
|
|
21
|
+
for (const [name, relay] of handlers) process.removeListener(name, relay);
|
|
22
|
+
if (signal) process.kill(process.pid, signal);
|
|
23
|
+
else process.exitCode = code;
|
|
24
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"speech_worker_url": "ws://127.0.0.1:18213/tts",
|
|
3
|
+
"language": "en",
|
|
4
|
+
"max_new_tokens": 160,
|
|
5
|
+
"tool_timeout_s": 35,
|
|
6
|
+
"system_prompt": "Listen to the user and answer briefly in plain spoken text. Execute requested actions with the available tools. When the user asks you to look or asks about the current physical scene, call request_camera_view in still mode and use its visual observation before answering. Keep the camera idle during unrelated requests. Use get_system_snapshot for the device's specifications and peripheral_inventory to find connected serial, USB, Bluetooth, and network devices. Use their returned identifiers with the appropriate device tools. Use the clock, current location, and calculator tools when asked. For news or headlines, call get_news_headlines and attribute each spoken headline to its publisher. Discover other tools, including shell, terminal, files, and MCP, with tool_search and use exact arguments. Report actual tool errors and use their recovery information. Ground answers in tool receipts and current visual evidence. If a spoken address or identifier is unclear, ask the user to clarify instead of guessing."
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phosphor-harness",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "Local multimodal voice, vision and tool harness for Phosphor",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {"type": "git", "url": "git+https://github.com/robit-man/phosphor-harness.git"},
|
|
7
|
+
"homepage": "https://github.com/robit-man/phosphor-harness",
|
|
8
|
+
"bin": {"phosphor": "./bin/phosphor.cjs"},
|
|
9
|
+
"engines": {"node": ">=18"},
|
|
10
|
+
"os": ["linux"],
|
|
11
|
+
"cpu": ["x64", "arm64"],
|
|
12
|
+
"files": [
|
|
13
|
+
"bin/phosphor.cjs", "quickstart.sh", "scripts/*.sh", "scripts/*.py", "scripts/phosphor-weights.sha256",
|
|
14
|
+
"sophon_harness/*.py", "pyproject.toml", "sources.lock.json", "requirements-orin-voice.txt",
|
|
15
|
+
"ornith-profile.example.json", "profile.example.json"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {"access": "public", "registry": "https://registry.npmjs.org/"}
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "robit.sophon-native-server.v1",
|
|
3
|
+
"model": "midpoint/qwen",
|
|
4
|
+
"donor_config": "midpoint/donor",
|
|
5
|
+
"donor_projector": "midpoint/acoustic/comprehension-projector.gguf",
|
|
6
|
+
"connector": "midpoint/connector",
|
|
7
|
+
"speech_worker_url": "ws://127.0.0.1:18213/tts",
|
|
8
|
+
"language": "en",
|
|
9
|
+
"max_new_tokens": 160,
|
|
10
|
+
"system_prompt": "Listen to the user and answer briefly. Use the clock and calculator when asked. For the latest news or headlines, call get_news_headlines. A general news request can leave the query blank. Attribute each spoken headline to its publisher. Use web search and fetch for other current information. Discover other capabilities with tool_search and use exact arguments. Ground answers in returned tool data."
|
|
11
|
+
}
|
package/pyproject.toml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=75"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sophon-standalone-harness"
|
|
7
|
+
version = "0.4.1"
|
|
8
|
+
description = "Phosphor voice, vision and tool harness"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
license = {text = "Apache-2.0"}
|
|
11
|
+
dependencies = ["httpx>=0.27,<1"]
|
|
12
|
+
|
|
13
|
+
[project.scripts]
|
|
14
|
+
sophon-harness = "sophon_harness.cli:main"
|
|
15
|
+
sophon-tool-server = "sophon_harness.portal_server:main"
|