Refactor MLX and VLLM server options parsing and args building

This commit is contained in:
2025-09-19 19:39:36 +02:00
parent c7136d5206
commit 9eecb37aec
7 changed files with 382 additions and 869 deletions

View File

@@ -1,6 +1,7 @@
package vllm
package vllm_test
import (
"llamactl/pkg/backends/vllm"
"testing"
)
@@ -39,7 +40,7 @@ func TestParseVllmCommand(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result, err := ParseVllmCommand(tt.command)
result, err := vllm.ParseVllmCommand(tt.command)
if tt.expectErr {
if err == nil {
@@ -62,7 +63,7 @@ func TestParseVllmCommand(t *testing.T) {
func TestParseVllmCommandValues(t *testing.T) {
command := "vllm serve --model test-model --tensor-parallel-size 4 --gpu-memory-utilization 0.8 --enable-log-outputs"
result, err := ParseVllmCommand(command)
result, err := vllm.ParseVllmCommand(command)
if err != nil {
t.Fatalf("unexpected error: %v", err)
@@ -80,4 +81,4 @@ func TestParseVllmCommandValues(t *testing.T) {
if !result.EnableLogOutputs {
t.Errorf("expected enable_log_outputs true, got %v", result.EnableLogOutputs)
}
}
}