Something went wrong. Try again.
Routing embedding stack for Qwen3-Embedding-0.6B on Apple Silicon: orchestrator + MLX + llama.cpp backends
Something went wrong. Try again.
1.2 kB · 48 lines
Rust
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849mod backend_rust;mod backend_swift;mod config;mod dto;mod errors;mod prompt;mod router;mod splitter;mod tokenizer;
use anyhow::Result;use std::sync::Arc;use tracing::info;use tracing_subscriber::EnvFilter;
use crate::backend_rust::RustBackend;use crate::backend_swift::SwiftBackend;use crate::config::Config;use crate::router::{build_router, AppState};use crate::tokenizer::TokenCounter;
#[tokio::main]async fn main() -> Result<()> { tracing_subscriber::fmt() .with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into())) .init();
let cfg = Arc::new(Config::from_env()?); info!(?cfg, "starting embed-orchestrator");
let tokenizer = TokenCounter::load(&cfg.tokenizer_path)?; let swift = SwiftBackend::start(&cfg).await?; let rust = RustBackend::new(cfg.clone());
let state = Arc::new(AppState { cfg: cfg.clone(), tokenizer, swift, rust, });
let app = build_router(state); let addr = format!("0.0.0.0:{}", cfg.orch_port); let listener = tokio::net::TcpListener::bind(&addr).await?; info!(%addr, "listening"); axum::serve(listener, app).await?; Ok(())}