Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions internal/controller/child_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,21 @@ func sanitizeModelName(msvc *msv1alpha1.ModelService) string {
return sanitizedModelName
}

// pickLoadFormat returns the arg following "--load-format"
func pickLoadFormat(pd *msv1alpha1.PDSpec) string {
if pd == nil {
return ""
}
for _, c := range append(pd.Containers, pd.InitContainers...) {
for i := 0; i+1 < len(c.Args); i++ {
if c.Args[i] == "--load-format" {
return c.Args[i+1]
}
}
}
return ""
}

// mergePDService uses msvc fields to update childResource P/D Service
func (childResource *BaseConfig) mergePDService(ctx context.Context, msvc *msv1alpha1.ModelService, role string, scheme *runtime.Scheme) *BaseConfig {

Expand Down
5 changes: 5 additions & 0 deletions internal/controller/modelservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type TemplateVars struct {
DecodeServiceName string `json:"decodeServiceName,omitempty"`
InferencePoolName string `json:"inferencePoolName,omitempty"`
InferenceModelName string `json:"inferenceModelName,omitempty"`
LoadFormat string `json:"loadFormat,omitempty"`
}

// from populates the field values for TemplateVars from the model service
Expand Down Expand Up @@ -113,6 +114,10 @@ func (t *TemplateVars) from(ctx context.Context, msvc *msv1alpha1.ModelService)
t.InferenceModelName = infModelName(msvc)
t.ModelName = msvc.Spec.Routing.ModelName
t.SanitizedModelName = sanitizeModelName(msvc)
t.LoadFormat = pickLoadFormat(msvc.Spec.Decode)
if t.LoadFormat == "" {
t.LoadFormat = pickLoadFormat(msvc.Spec.Prefill)
}

if msvc.Spec.ModelArtifacts.AuthSecretName != nil {
t.AuthSecretName = *msvc.Spec.ModelArtifacts.AuthSecretName
Expand Down
Loading