feat: allow specifying port via command line argument

This change allows the port to be specified via command line arguments, providing flexibility. The port is parsed from the arguments, defaulting to 8080 if not provided.
This commit is contained in:
Akarshan Biswas 2025-05-30 13:41:18 +05:30 committed by Louis
parent 5d61062b0e
commit f9d3935269
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -83,7 +83,13 @@ pub async fn load_llama_model(
)));
}
let port = 8080; // Default port
let port = args
.iter()
.position(|arg| arg == "--port")
.and_then(|i| args.get(i + 1))
.cloned()
.unwrap_or_default();
let modelPath = args
.iter()
.position(|arg| arg == "-m")