mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 09:04:27 +00:00
Setup routing
This commit is contained in:
@@ -61,3 +61,42 @@ func ListDevicesHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
w.Write(output)
|
||||
}
|
||||
|
||||
// func launchHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// model := chi.URLParam(r, "model")
|
||||
// if model == "" {
|
||||
// http.Error(w, "Model parameter is required", http.StatusBadRequest)
|
||||
// return
|
||||
// }
|
||||
|
||||
// cmd := execLLama(model)
|
||||
// if err := cmd.Start(); err != nil {
|
||||
// http.Error(w, "Failed to start llama server: "+err.Error(), http.StatusInternalServerError)
|
||||
// return
|
||||
// }
|
||||
|
||||
// instances[model] = cmd
|
||||
// w.Write([]byte("Llama server started for model: " + model))
|
||||
// }
|
||||
|
||||
// func stopHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// model := chi.URLParam(r, "model")
|
||||
// if model == "" {
|
||||
// http.Error(w, "Model parameter is required", http.StatusBadRequest)
|
||||
// return
|
||||
// }
|
||||
|
||||
// cmd, exists := instances[model]
|
||||
// if !exists {
|
||||
// http.Error(w, "No running instance for model: "+model, http.StatusNotFound)
|
||||
// return
|
||||
// }
|
||||
|
||||
// if err := cmd.Process.Signal(os.Interrupt); err != nil {
|
||||
// http.Error(w, "Failed to stop llama server: "+err.Error(), http.StatusInternalServerError)
|
||||
// return
|
||||
// }
|
||||
|
||||
// delete(instances, model)
|
||||
// w.Write([]byte("Llama server stopped for model: " + model))
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user