Skip to content

Commit 943f9bc

Browse files
authored
Check parent field in /models response (#276)
Signed-off-by: irar2 <[email protected]>
1 parent 16f4b2e commit 943f9bc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/llm-d-inference-sim/lora_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"encoding/json"
2222
"errors"
23+
"strings"
2324

2425
. "github.com/onsi/ginkgo/v2"
2526
. "github.com/onsi/gomega"
@@ -32,7 +33,7 @@ import (
3233

3334
var _ = Describe("LoRAs", func() {
3435
Context("LoRAs config and load", func() {
35-
It("Should config, load and load LoRAs correctly", func() {
36+
It("Should config, load and unload LoRAs correctly", func() {
3637
ctx := context.TODO()
3738
client, err := startServerWithArgs(ctx,
3839
[]string{"cmd", "--model", testModel, "--mode", common.ModeEcho,
@@ -80,6 +81,15 @@ var _ = Describe("LoRAs", func() {
8081
Expect(modelsResp).NotTo(BeNil())
8182
Expect(modelsResp.Data).To(HaveLen(4))
8283

84+
for _, model := range modelsResp.Data {
85+
if strings.HasPrefix(model.ID, "lora") {
86+
Expect(model.Parent).ToNot(BeNil())
87+
Expect(*model.Parent).To(Equal(testModel))
88+
} else {
89+
Expect(model.Parent).To(BeNil())
90+
}
91+
}
92+
8393
// Request to lora1, should work now
8494
resp, err = openaiclient.Chat.Completions.New(ctx, params)
8595
Expect(err).ToNot(HaveOccurred())

0 commit comments

Comments
 (0)