Add vLLM models authentication diagnostics
This commit is contained in:
16
internal/llm/vllm_authentication.go
Normal file
16
internal/llm/vllm_authentication.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package llm
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
func recognizedVLLMModelsResponse(contents []byte) bool {
|
||||
var envelope map[string]json.RawMessage
|
||||
if json.Unmarshal(contents, &envelope) != nil || envelope == nil {
|
||||
return false
|
||||
}
|
||||
var object string
|
||||
if json.Unmarshal(envelope["object"], &object) != nil || object != "list" {
|
||||
return false
|
||||
}
|
||||
var data []json.RawMessage
|
||||
return json.Unmarshal(envelope["data"], &data) == nil && data != nil
|
||||
}
|
||||
Reference in New Issue
Block a user