Skip to content

Commit 8c512f4

Browse files
committed
Added voice message support and multi-message handling
1 parent eb3c49e commit 8c512f4

6 files changed

Lines changed: 1269 additions & 339 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.env.*
55
!.env.example
66
hpcrelay/
7+
*start*.sh*
78

89
# Python
910
__pycache__/
@@ -42,6 +43,9 @@ opencode_chat_viewer/
4243
# Session data
4344
*session*.json
4445
*task*.json
46+
inbox/
47+
run_traces/
48+
*.pid
4549

4650
# Workspace data
4751
workspace*/

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Contributing to HPC-Relay
1+
# Contributing to OpencodeClaw
22

33
Thanks for your interest in contributing! This guide covers the basics.
44

55
## Reporting Issues
66

7-
- Search [existing issues](https://github.com/MichaelG0501/hpc-relay/issues) first
7+
- Search [existing issues](https://github.com/MichaelG0501/OpencodeClaw/issues) first
88
- Include your Python version, OS, and relay log output
99
- For security issues, **do not** open a public issue -- email the maintainer directly
1010

README.md

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<div align="center">
22

3-
# HPC-Relay
3+
# OpencodeClaw
44

55
### Opencode AI agent on your phone - Access anywhere!
66

77
[![Python 3.9+](https://img.shields.io/badge/Python-3.9+-blue?style=flat-square&logo=python)](https://python.org)
88
[![Telegram Bot API](https://img.shields.io/badge/Telegram-Bot%20API-26A5E4?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
99
[![OpenCode](https://img.shields.io/badge/Agent-OpenCode%20%7C%20Claude%20Code-green?style=flat-square)](https://opencode.ai)
1010
[![License: BSD-3](https://img.shields.io/badge/License-BSD--3-yellow?style=flat-square)](LICENSE)
11-
[![Lint](https://github.com/MichaelG0501/hpc-relay/actions/workflows/lint.yml/badge.svg)](https://github.com/MichaelG0501/hpc-relay/actions)
11+
[![Lint](https://github.com/MichaelG0501/OpencodeClaw/actions/workflows/lint.yml/badge.svg)](https://github.com/MichaelG0501/OpencodeClaw/actions)
1212

1313
**No VPN. No terminal. Just work on your phone.**
1414

15-
[Website](https://michaelg0501.github.io/hpc-relay/) · [Quick Start](#quick-start) · [Commands Reference](#commands-reference) · [Model Support](#supported-models) · [File Transfers](#file-transfers) · [Chat Viewer](#chat-history-viewer)
15+
[Website](https://michaelg0501.github.io/OpencodeClaw/) · [Quick Start](#quick-start) · [Commands Reference](#commands-reference) · [Model Support](#supported-models) · [File Transfers](#file-transfers) · [Chat Viewer](#chat-history-viewer)
1616

1717
</div>
1818

@@ -32,13 +32,13 @@
3232
3333
---
3434

35-
## Why HPC-Relay
35+
## Why OpencodeClaw
3636

3737
You’re a researcher or developer. Your data and code live on an HPC cluster, your WSL setup, or your lab macOS machine — but you’re not always sitting at your workstation.
3838

3939
Sometimes you’re travelling, commuting, or just away from your laptop. You still want to run a quick analysis, check results, or ask an AI agent to sanity-check something. Or you want AI agent to start planning and implementing a long analysis while you take a rest.
4040

41-
**HPC-Relay lets you do that from your phone.**
41+
**OpencodeClaw lets you do that from your phone.**
4242

4343
Just message your workstation or HPC through Telegram.
4444

@@ -71,6 +71,7 @@ You authenticate **once**. Everything else is automatic.
7171
| **No VPN on phone** | Relay sits inside the authenticated network |
7272
| **AI session memory** | Parses & re-injects `sessionID` -- full context from cold start |
7373
| **File transfer** | Download files from the target machine to Telegram (`/send <path>`) |
74+
| **Voice notes / audio** | Telegram voice notes can be received and processed; optional local `faster-whisper` pre-transcription for low-latency speech-to-text |
7475
| **File upload** | Upload files from target to cloud (`/upload <path>`) |
7576
| **Wildcard fetch** | Send multiple files with glob patterns (e.g. `/send Auto*.png`) |
7677
| **Chat history viewer** | Generate interactive HTML viewer of all AI conversations |
@@ -104,6 +105,7 @@ Generate an expression heatmap with random synthetic data.
104105
| `/send Auto*.png` | Download matching files (wildcard) | `/send /project/Auto*.png` |
105106
| `/upload <path>` | Upload a file from target machine to cloud | `/upload ~/data/input.csv` |
106107
| `/scheduled` | Open scheduled tasks manager (edit/delete interactively) | `/scheduled` |
108+
| voice / audio / video note | Upload from Telegram and analyze with the agent; for best latency, enable optional local `faster-whisper` transcription | send a voice note |
107109

108110
### Shell Commands
109111

@@ -223,11 +225,11 @@ curl -fsSL https://opencode.ai/install | bash
223225
### Step 4 -- Configure and Run
224226

225227
```bash
226-
git clone https://github.com/MichaelG0501/hpc-relay.git
227-
cd hpc-relay
228+
git clone https://github.com/MichaelG0501/OpencodeClaw.git
229+
cd OpencodeClaw
228230

229231
# Create a separate Python environment (recommended)
230-
# python3 -m venv hpcrelay && source hpcrelay/bin/activate
232+
# python3 -m venv ~/.venvs/OpencodeClaw && source ~/.venvs/OpencodeClaw/bin/activate
231233
pip install -r requirements.txt
232234
cp .env.example .env
233235
```
@@ -262,6 +264,32 @@ Generate an expression heatmap with random data.
262264

263265
The AI executes on the target machine and streams the response back -- formatted, chunked, and readable.
264266

267+
### Optional: Fast local speech-to-text (recommended)
268+
269+
Telegram voice notes usually arrive as **OGG/Opus**. OpencodeClaw can forward audio directly to the agent, but this is often slower than pre-transcribing locally.
270+
271+
For lower latency, install **ffmpeg** + **faster-whisper** and let the relay transcribe pure voice/audio messages first, then send the transcript to the agent.
272+
273+
Recommended local setup (on the relay machine):
274+
275+
```bash
276+
sudo apt-get update
277+
sudo apt-get install -y ffmpeg python3-pip
278+
~/local_relay/OpencodeClaw/bin/python -m pip install --upgrade pip setuptools wheel
279+
~/local_relay/OpencodeClaw/bin/python -m pip install faster-whisper
280+
```
281+
282+
The first model download (for example `small`) is stored in the user cache, typically under:
283+
284+
```bash
285+
~/.cache/huggingface/hub/models--Systran--faster-whisper-small
286+
```
287+
288+
Notes:
289+
- **Python package** lives in your shared relay venv (recommended: `~/.venvs/OpencodeClaw`)
290+
- **Model weights** live in the user cache, not inside the venv itself
291+
- If local Whisper is not installed, the relay can still fall back to agent-side audio analysis (slower)
292+
265293
---
266294

267295
## Chat History Viewer
@@ -296,7 +324,7 @@ python3 tools/chat_viewer.py
296324

297325
## Supported Models
298326

299-
HPC-Relay works with [OpenCode](https://opencode.ai), which routes to every major AI provider. You can also swap in **Claude Code**, **Aider**, or any headless CLI agent.
327+
OpencodeClaw works with [OpenCode](https://opencode.ai), which routes to every major AI provider. You can also swap in **Claude Code**, **Aider**, or any headless CLI agent.
300328

301329
| Provider | Models | Notes |
302330
|---|---|---|
@@ -312,7 +340,7 @@ HPC-Relay works with [OpenCode](https://opencode.ai), which routes to every majo
312340

313341
## HPC Best Practices
314342

315-
Many HPC clusters **prohibit heavy computation on login nodes**. HPC-Relay is designed with this in mind:
343+
Many HPC clusters **prohibit heavy computation on login nodes**. OpencodeClaw is designed with this in mind:
316344

317345
### Recommended Workflow
318346

@@ -345,7 +373,7 @@ Then:
345373
| `rclone sync` (lightweight) | Multi-core jobs |
346374
| AI agent (ephemeral, short-lived) | Long-running processes |
347375

348-
> HPC-Relay's daemonless architecture means the AI agent spins up, answers, and terminates -- no idle processes consuming shared resources.
376+
> OpencodeClaw's daemonless architecture means the AI agent spins up, answers, and terminates -- no idle processes consuming shared resources.
349377
350378
---
351379

@@ -371,7 +399,7 @@ rclone sync ~/results gdrive:HPC-Results/
371399

372400
### Why Not tmux Screen-Scraping?
373401

374-
| Problem | HPC-Relay Solution |
402+
| Problem | OpencodeClaw Solution |
375403
|---|---|
376404
| ANSI escape codes pollute output | `--format json` -- structured, parseable |
377405
| Async timing -- don't know when AI finishes | JSON event stream with explicit completion |
@@ -434,7 +462,7 @@ Use `/scheduled` for all scheduled task management.
434462

435463
### Workspace Separation (multi-chat isolation)
436464

437-
HPC-Relay can isolate sessions/tasks/workdir per chat. Configure with env:
465+
OpencodeClaw can isolate sessions/tasks/workdir per chat. Configure with env:
438466

439467
```bash
440468
CHANNEL_WORKSPACES={"8670800334":{"name":"mg","workdir":"~/workspace_mg","allowed_users":[8670800334]}}

index.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta property="og:title" content="HPC-Relay -- AI on Your HPC, WSL, or macOS, From Your Phone">
7+
<meta property="og:title" content="OpencodeClaw -- AI on Your HPC, WSL, or macOS, From Your Phone">
88
<meta property="og:description"
99
content="Control AI coding agents on HPC clusters, WSL setups, or lab macOS machines via Telegram. Transfer files, switch models, manage sessions. No VPN needed.">
1010
<meta property="og:type" content="website">
1111
<meta name="twitter:card" content="summary_large_image">
12-
<title>HPC-Relay -- AI on Your HPC, WSL, or macOS, From Your Phone</title>
12+
<title>OpencodeClaw -- AI on Your HPC, WSL, or macOS, From Your Phone</title>
1313
<link rel="preconnect" href="https://fonts.googleapis.com">
1414
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1515
<link
@@ -951,15 +951,15 @@
951951
<div class="inner">
952952
<div class="nav-logo">
953953
<div class="dot"></div>
954-
hpc-relay
954+
OpencodeClaw
955955
</div>
956956
<div class="nav-links">
957957
<a href="#features">Features</a>
958958
<a href="#commands">Commands</a>
959959
<a href="#models">Models</a>
960960
<a href="#setup">Setup</a>
961961
<a href="#hpc-practices">HPC Tips</a>
962-
<a href="https://github.com/MichaelG0501/hpc-relay" target="_blank">GitHub</a>
962+
<a href="https://github.com/MichaelG0501/OpencodeClaw" target="_blank">GitHub</a>
963963
</div>
964964
</div>
965965
</nav>
@@ -979,7 +979,7 @@ <h1>
979979
lauch jobs, debug and check results, simply send a message. Built for researchers and bioinformaticians.
980980
</p>
981981
<div class="hero-actions">
982-
<a href="https://github.com/MichaelG0501/hpc-relay" class="btn-primary" target="_blank">
982+
<a href="https://github.com/MichaelG0501/OpencodeClaw" class="btn-primary" target="_blank">
983983
Star on GitHub
984984
</a>
985985
<a href="#setup" class="btn-secondary">
@@ -1116,13 +1116,13 @@ <h3>Chat History Viewer</h3>
11161116
<div class="container">
11171117
<div class="section-label reveal">Control</div>
11181118
<h2 class="section-title reveal">Commands Reference</h2>
1119-
<p class="section-sub reveal">Everything you can do from Telegram. Supports per-chat workspace/session isolation via env config.</p>
1119+
<p class="section-sub reveal">Everything you can do from Telegram. Supports per-chat workspace/session isolation via env config, plus optional low-latency local voice transcription with faster-whisper.</p>
11201120
<div class="cmd-grid">
11211121

11221122
<div class="cmd-card reveal">
11231123
<div class="cmd-label">AI Prompt</div>
11241124
<div class="cmd-syntax">just type naturally</div>
1125-
<div class="cmd-desc">Any message is sent as a prompt to the AI agent on HPC.</div>
1125+
<div class="cmd-desc">Any text message is sent as a prompt to the AI agent on HPC. Voice/audio messages can also be received and, optionally, pre-transcribed locally with faster-whisper before reaching the agent.</div>
11261126
</div>
11271127

11281128
<div class="cmd-card reveal">
@@ -1161,6 +1161,12 @@ <h2 class="section-title reveal">Commands Reference</h2>
11611161
<div class="cmd-desc">Download all matching files. Supports glob patterns.</div>
11621162
</div>
11631163

1164+
<div class="cmd-card reveal">
1165+
<div class="cmd-label">Voice Note / Audio</div>
1166+
<div class="cmd-syntax">send a Telegram voice note</div>
1167+
<div class="cmd-desc">Receive Telegram voice/audio messages. For best latency, enable optional local <strong>faster-whisper</strong> transcription so the relay converts speech to text before passing it to the agent.</div>
1168+
</div>
1169+
11641170
<div class="cmd-card reveal">
11651171
<div class="cmd-label">Upload File</div>
11661172
<div class="cmd-syntax">/upload ~/data/input.csv</div>
@@ -1273,7 +1279,7 @@ <h3>Create a Telegram Bot</h3>
12731279
<h3>Clone, Configure, Run</h3>
12741280
<p>Clone the repo, copy <code style="font-family:monospace">.env.example</code> to <code
12751281
style="font-family:monospace">.env</code>, fill in your values — that's all the config you need.</p>
1276-
<code>git clone https://github.com/MichaelG0501/hpc-relay.git&#10;cd hpc-relay&#10;&#10;# Create a separate Python environment (recommended)&#10;# python3 -m venv hpcrelay && source hpcrelay/bin/activate&#10;&#10;pip install -r requirements.txt&#10;cp .env.example .env&#10;&#10;# Edit .env with your values&#10;python relay_bot.py</code>
1282+
<code>git clone https://github.com/MichaelG0501/OpencodeClaw.git&#10;cd OpencodeClaw&#10;&#10;# Create a separate Python environment (recommended)&#10;# python3 -m venv OpencodeClaw && source OpencodeClaw/bin/activate&#10;&#10;pip install -r requirements.txt&#10;cp .env.example .env&#10;&#10;# Edit .env with your values&#10;python relay_bot.py</code>
12771283
</div>
12781284
</div>
12791285

@@ -1385,14 +1391,14 @@ <h3>Chat History Viewer</h3>
13851391
<h2>Ready to control your cluster?</h2>
13861392
<p>Clone the repo, edit your config, and send your first command from Telegram.</p>
13871393
<div class="actions">
1388-
<a href="https://github.com/MichaelG0501/hpc-relay" class="btn-primary" target="_blank">Star on GitHub</a>
1394+
<a href="https://github.com/MichaelG0501/OpencodeClaw" class="btn-primary" target="_blank">Star on GitHub</a>
13891395
</div>
13901396
</div>
13911397
</div>
13921398
</section>
13931399

13941400
<footer>
1395-
<p>Built for researchers &middot; <a href="https://github.com/MichaelG0501/hpc-relay">GitHub</a> &middot; BSD-3
1401+
<p>Built for researchers &middot; <a href="https://github.com/MichaelG0501/OpencodeClaw">GitHub</a> &middot; BSD-3
13961402
License</p>
13971403
</footer>
13981404

0 commit comments

Comments
 (0)