Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=+fp16"]
44 changes: 44 additions & 0 deletions .github/workflows/rust_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,47 @@ jobs:

- name: Build binary
run: cargo build --release

build-aarch64:
name: Build (aarch64)
runs-on: ubuntu-latest
container:
image: debian:bookworm-slim
steps:
- name: Install base dependencies
shell: bash
run: |
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture arm64
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates \
pkg-config \
libssl-dev \
libssl-dev:arm64 \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \
build-essential \
git \
curl \
unzip \
cmake

- name: Check out repository
uses: actions/checkout@v4

- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Add Rust target
run: rustup target add aarch64-unknown-linux-gnu

- name: Build binary
env:
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
PKG_CONFIG_ALLOW_CROSS: "1"
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
run: cargo build --release --target aarch64-unknown-linux-gnu
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ Edit `config.toml` to customize the VAD, ASR, LLM, TTS services, as well as prom
cargo build --release
```

**Note for aarch64 (ARM64) builds:** When cross-compiling for aarch64, the required `fp16` target feature is automatically enabled via `.cargo/config.toml`. If building natively on aarch64, you may need to set:

```
RUSTFLAGS="-C target-feature=+fp16" cargo build --release
```

### Configure AI services

The `config.toml` can use any combination of open-source or proprietary AI services, as long as they offer OpenAI-compatible API endpoints. Here are instructions to start open source AI servers for the EchoKit server.
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use axum::{
use clap::Parser;
use config::Config;

#[allow(deprecated)]
use crate::{config::ASRConfig, services::realtime_ws::StableRealtimeConfig};

pub mod ai;
Expand Down Expand Up @@ -55,9 +56,11 @@ async fn routes(
});

let mut tool_set = ai::openai::tool::ToolSet::default();
#[allow(deprecated)]
let mut real_config: Option<StableRealtimeConfig> = None;

// todo: support other configs
#[allow(deprecated)]
match &config.config {
config::AIConfig::Stable {
llm: config::LLMConfig::OpenAIChat(chat_llm),
Expand Down Expand Up @@ -173,6 +176,7 @@ async fn routes(
)))
.layer(axum::Extension(record_config.clone()));

#[allow(deprecated)]
if let Some(real_config) = real_config {
log::info!(
"Adding realtime WebSocket handler with config: {:?}",
Expand Down
2 changes: 2 additions & 0 deletions src/services/realtime_ws.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)]

use axum::{
extract::{Extension, WebSocketUpgrade, ws::WebSocket},
response::IntoResponse,
Expand Down