Support remote SAM3 inference through a private Metal worker

This commit is contained in:
Joshua Warren
2026-10-08 11:47:59 -05:00
parent b8df5f472c
commit 0613f925de
10 changed files with 350 additions and 19 deletions
@@ -0,0 +1,8 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut args = std::env::args().skip(1);
let dir = args.next().ok_or("usage: lightcraft-sam3-worker MODEL_DIR [127.0.0.1:8793]")?;
let address = args.next().unwrap_or_else(|| "127.0.0.1:8793".into()).parse()?;
let device = candle_core::Device::new_metal(0)?;
lightcraft_segment::remote::serve(address, std::path::Path::new(&dir), device)?;
Ok(())
}