Skip to content

Commit 4e54775

Browse files
committed
Update examples
Signed-off-by: Michael Yuan <michael@secondstate.io>
1 parent 89b1913 commit 4e54775

28 files changed

Lines changed: 413 additions & 700 deletions

File tree

Cargo.lock

Lines changed: 388 additions & 420 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "echokit_server"
3-
version = "0.3.0"
3+
version = "0.3.2"
44
edition = "2024"
55

66
[dependencies]

config.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ url = "https://api.openai.com/v1/audio/transcriptions"
77
api_key = "sk_ABCD"
88
model = "gpt-4o-mini-transcribe"
99
lang = "en"
10-
# Optional: requires a local Silero VAD server: https://github.com/second-state/silero_vad_server
11-
vad_url = "http://localhost:9093/v1/audio/vad"
12-
# vad_realtime_url = "ws://localhost:9093/v1/audio/realtime_vad"
1310

1411
[tts]
1512
platform = "openai"
@@ -34,4 +31,4 @@ You are a helpful assistant. Answer truthfully and concisely. Always answer in E
3431
- NEVER use tables
3532
- Answer in complete English sentences as if you are in a conversation.
3633
37-
"""
34+
"""
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
11
This doc guides you through building and deploying the echokit_server container to Fly.io.
22

33
## Prerequisites
4+
45
- flyctl installed: see https://github.com/superfly/flyctl
56
- Docker installed and running locally
67
- A unique Fly app name (Fly app names are globally unique)
78

89
## 1) Create the Fly app
10+
911
```bash
1012
fly app create --name echokit-server-[something-unique]
1113
```
1214

1315
## 2) Build the Docker image
14-
From the server-vad directory, ensure `config.toml` is valid, then build:
16+
17+
From the `server` directory, ensure `config.toml` is valid, then build:
18+
1519
```bash
16-
cd server-vad
20+
cd ../server
1721
docker build -t registry.fly.io/[your_app_name]:tag .
1822
```
1923

2024
## 3) Push the image to Fly
25+
2126
Authenticate to the Fly registry and push the image:
27+
2228
```bash
2329
fly auth docker
2430
docker push registry.fly.io/[your_app_name]:tag
2531
```
2632

2733
## 4) Configure Fly to use the image
34+
2835
Update `fly.toml` to point to `registry.fly.io/[your_app_name]:tag`.
2936

3037
## 5) Deploy
31-
From the `docker` directory:
38+
39+
From the `docker/fly` directory:
40+
3241
```bash
3342
fly deploy
3443
```
3544

3645
## Managing machines
46+
3747
- Deploy creates two machines in the same region by default. Remove one if you only need a single instance:
3848
```bash
3949
fly machine list # get machine IDs
File renamed without changes.

docker/server-vad/Dockerfile

Lines changed: 0 additions & 120 deletions
This file was deleted.

docker/server-vad/README.md

Lines changed: 0 additions & 55 deletions
This file was deleted.

docker/server-vad/config.toml

Lines changed: 0 additions & 34 deletions
This file was deleted.

docker/server-vad/hello.wav

-16.1 KB
Binary file not shown.

docker/server/README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,20 @@ docker run --rm \
1313
-p 8080:8080 \
1414
-v $(pwd)/config.toml:/app/config.toml \
1515
-v $(pwd)/record:/app/record \
16-
secondstate/echokit:latest-server
16+
secondstate/echokit:latest
1717
```
1818

1919
Mount your `config.toml` directly into `/app/config.toml`. If you need to override additional assets such as `hello.wav`, mount them individually alongside the config file. The server writes any generated artifacts to `/app/record`, so ensure the `record` directory exists locally and is writable. The container executes `echokit_server config.toml` by default, reading logs at the `info` level.
2020

2121
## Build
2222

23-
```sh
24-
docker build -t secondstate/echokit:latest-server .
25-
```
26-
27-
The build automatically selects the correct release artifact for your build architecture using the BuildKit-provided `TARGETPLATFORM`/`TARGETARCH` arguments. Override the downloaded release by supplying `--build-arg ECHOKIT_VERSION=<version>` (for example `0.1.1`) if you want a different tag.
28-
29-
## Multi-platform build
30-
3123
Use Buildx to produce and publish a multi-arch manifest in one command. BuildKit injects `TARGETPLATFORM` (`linux/amd64`, `linux/arm64`, etc.), so you do not need to set them manually.
3224

3325
```sh
3426
docker buildx build \
3527
--platform linux/amd64,linux/arm64 \
36-
--build-arg ECHOKIT_VERSION=0.1.1 \
37-
--tag secondstate/echokit:latest-server \
28+
--build-arg ECHOKIT_VERSION=0.3.1 \
29+
--tag secondstate/echokit:latest \
3830
.
3931
```
4032

@@ -44,5 +36,5 @@ Adjust `ECHOKIT_VERSION` as needed; omit the flag to fall back to the default ve
4436

4537
```sh
4638
docker login
47-
docker push secondstate/echokit:latest-server
39+
docker push secondstate/echokit:latest
4840
```

0 commit comments

Comments
 (0)