feat(app): start Strata from the data folder and point the brain at it
M5 step 4, second part. The services start the LLM first: the installed Strata with the M0 kit's model and normal placement (models in models/llm, parallel 1, or 2 when a chat channel answers every message, pictures off, --restart), wait until /v1/models lists the model, and stop it last. The first start downloads the model; the dashboard shows Strata's last line and percentage, and stop also cancels a start (the server is cleared). llm.url uses a server the app does not start. On every start the app writes config/brain.json (Strata's /v1, the listed model id, memory/jarvis.db) and hands it to the worker as JARVIS_CONFIG_PATH. Loading a config with its own db_path no longer creates ~/.local/share/jarvis. service_start/service_restart run in the background. Settings gain llm.context and llm.port (model screen) and llm.url (file only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
//! JARVIS_LIVE_ROUND_TRIP=1 JARVIS_LIVE_BOT_TOKEN=... JARVIS_LIVE_SPEAKER_TOKEN=... \
|
||||
//! JARVIS_LIVE_GUILD=<server id> JARVIS_LIVE_VOICE_CHANNEL=<voice channel id> \
|
||||
//! JARVIS_VOICE_PYTHON=<worker venv python> JARVIS_MELO_PYTHON=<MeloTTS venv python> \
|
||||
//! JARVIS_CONFIG_PATH=<jarvis settings whose ollama_base_url is Strata's /v1> \
|
||||
//! JARVIS_LIVE_LLM_URL=<Strata's /v1 address, e.g. a tunnel to the game PC> \
|
||||
//! JARVIS_LIVE_QUESTIONS=<dir with refs.json and 16 kHz mono wavs> [JARVIS_LIVE_ROUNDS=2] \
|
||||
//! cargo test --release --test live_round_trip -- --nocapture
|
||||
//!
|
||||
@@ -28,6 +28,7 @@ use async_trait::async_trait;
|
||||
use jarvis_app::discord::CoreEvent;
|
||||
use jarvis_app::receive::{opus_payload, OpusFrames, SpeakerStream};
|
||||
use jarvis_app::services::start_services;
|
||||
use jarvis_app::strata::Llm;
|
||||
use jarvis_app::worker_client::{WorkerClient, WorkerClientOptions};
|
||||
use serde_json::{json, Value};
|
||||
use serenity::all::{ChannelId, Client, Context, EventHandler, GatewayIntents, GuildId, Ready, UserId};
|
||||
@@ -174,7 +175,7 @@ async fn conversation_round_trip_on_real_discord() {
|
||||
let voice: u64 = env("JARVIS_LIVE_VOICE_CHANNEL").parse().unwrap();
|
||||
let rounds: usize = std::env::var("JARVIS_LIVE_ROUNDS").ok().and_then(|v| v.parse().ok()).unwrap_or(2);
|
||||
let questions = PathBuf::from(env("JARVIS_LIVE_QUESTIONS"));
|
||||
env("JARVIS_CONFIG_PATH"); // the worker's brain reads it
|
||||
env("JARVIS_LIVE_LLM_URL"); // the services point the brain at it (llm.url)
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||
|
||||
// The speaker bot first: it checks the channel is free before anything joins.
|
||||
@@ -212,9 +213,10 @@ async fn conversation_round_trip_on_real_discord() {
|
||||
// The "person" here is a bot, so bots must be heard.
|
||||
"voice": {"listenToBots": true},
|
||||
"voiceWorker": {"python": env("JARVIS_VOICE_PYTHON"), "cwd": root.join("../src"), "args": args},
|
||||
"llm": {"url": env("JARVIS_LIVE_LLM_URL")},
|
||||
})).unwrap()).unwrap();
|
||||
std::env::set_var("JARVIS_DISCORD_TOKEN", &bot_token);
|
||||
let services = tokio::time::timeout(Duration::from_secs(300), start_services(&data)).await
|
||||
let services = tokio::time::timeout(Duration::from_secs(300), start_services(&data, Arc::new(Llm::new(&data)))).await
|
||||
.expect("services start in time").expect("services start");
|
||||
services.worker.wait_ready(Duration::from_secs(240)).await.expect("worker ready");
|
||||
let core = services.core.clone();
|
||||
|
||||
Reference in New Issue
Block a user