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
11 changes: 11 additions & 0 deletions .github/actions/sentry_cli/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
inputs:
version:
required: false
default: "2.39.1"
runs:
using: "composite"
steps:
- run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION="${{ inputs.version }}" sh
shell: bash
- run: sentry-cli --version
shell: bash
93 changes: 93 additions & 0 deletions .github/workflows/ai_cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
on:
workflow_dispatch:

jobs:
compute-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- run: git fetch --tags --force
- uses: ./.github/actions/doxxer_install
- id: version
run: |
VERSION=$(doxxer --config doxxer.ai.toml next patch)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Computed version: $VERSION"

build:
needs: compute-version
runs-on: depot-ubuntu-24.04-8
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust_install
with:
platform: linux
- run: |
cargo build --release -p ai
objcopy --only-keep-debug target/release/ai target/release/ai.debug
objcopy --strip-debug --strip-unneeded target/release/ai
objcopy --add-gnu-debuglink=target/release/ai.debug target/release/ai
env:
CARGO_PROFILE_RELEASE_DEBUG: "true"
- uses: actions/upload-artifact@v4
with:
name: ai-binary
path: target/release/ai
retention-days: 1
- uses: actions/upload-artifact@v4
with:
name: ai-debug
path: target/release/ai.debug
retention-days: 1

sentry-upload:
needs: [compute-version, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ai-debug
path: ./debug
- uses: ./.github/actions/sentry_cli
- run: sentry-cli debug-files upload --include-sources ./debug
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}

deploy:
needs: [compute-version, build, sentry-upload]
runs-on: depot-ubuntu-24.04-8
timeout-minutes: 60
concurrency: ai-fly-deploy
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ai-binary
path: ./apps/ai/bin
- run: chmod +x ./apps/ai/bin/ai
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --config apps/ai/fly.toml --dockerfile apps/ai/Dockerfile --remote-only -e APP_VERSION=${{ needs.compute-version.outputs.version }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

tag:
needs: [compute-version, deploy]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ai_v${{ needs.compute-version.outputs.version }}
tag_prefix: ""
23 changes: 23 additions & 0 deletions .github/workflows/ai_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
workflow_dispatch:
push:
branches:
- main
paths:
- apps/ai/**
- crates/llm-proxy/**
- crates/transcribe-proxy/**
pull_request:
branches:
- main
paths:
- apps/ai/**
- crates/llm-proxy/**
- crates/transcribe-proxy/**
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust_install
- run: cargo check -p ai
83 changes: 63 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ debug = false
[workspace]
resolver = "2"
members = [
"apps/ai",
"apps/desktop/src-tauri",
"apps/granola",
"apps/stt",
"crates/*",
"owhisper/*",
"plugins/*",
Expand Down Expand Up @@ -48,6 +48,7 @@ hypr-language = { path = "crates/language", package = "language" }
hypr-llama = { path = "crates/llama", package = "llama" }
hypr-llm = { path = "crates/llm", package = "llm" }
hypr-llm-interface = { path = "crates/llm-interface", package = "llm-interface" }
hypr-llm-proxy = { path = "crates/llm-proxy", package = "llm-proxy" }
hypr-loops = { path = "crates/loops", package = "loops" }
hypr-mac = { path = "crates/mac", package = "mac" }
hypr-moonshine = { path = "crates/moonshine", package = "moonshine" }
Expand Down
10 changes: 4 additions & 6 deletions apps/stt/Cargo.toml → apps/ai/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
[package]
name = "stt-server"
name = "ai"
version = "0.1.0"
edition = "2024"

[[bin]]
name = "stt"
path = "src/main.rs"

[dependencies]
hypr-llm-proxy = { workspace = true }
hypr-transcribe-proxy = { workspace = true }
owhisper-providers = { workspace = true }

Expand All @@ -24,4 +21,5 @@ url = { workspace = true }

dotenvy = { workspace = true }
jsonwebtoken = { workspace = true }
sentry = { workspace = true }
sentry = { workspace = true, features = ["tower", "tower-axum-matched-path", "tracing"] }
tower = { workspace = true }
9 changes: 9 additions & 0 deletions apps/ai/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY bin/ai /app/ai

EXPOSE 3000
CMD ["/app/ai"]
42 changes: 42 additions & 0 deletions apps/ai/fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
app = 'hyprnote-ai'
primary_region = 'sjc'
kill_signal = 'SIGTERM'
kill_timeout = 30
swap_size_mb = 512

[build]
dockerfile = "Dockerfile"

[deploy]
strategy = "bluegreen"

[env]
PORT = "3000"
SENTRY_ENVIRONMENT = "production"

[http_service]
processes = ['app']
internal_port = 3000
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 1

[http_service.concurrency]
type = "connections"
hard_limit = 200
soft_limit = 150

[[http_service.checks]]
grace_period = "20s"
interval = "15s"
method = "GET"
path = "/llm/completions"
protocol = "http"
timeout = "4s"

[[vm]]
processes = ['app']
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
Loading
Loading