Include local backend target in checkpoint identity

This commit is contained in:
2026-07-30 05:17:39 +00:00
parent 715fff7b72
commit 241e9d2a89
4 changed files with 106 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ type PromptKitClient struct {
recorder *LLMProfileRecorder
profileDir string
profileFile string
localEndpoint string
reasoningEffort *string
}
@@ -70,9 +71,11 @@ func NewPromptKitClient(cfg PromptKitClientConfig) (*PromptKitClient, error) {
if profileFile := strings.TrimSpace(cfg.ProfileFile); profileFile != "" {
options = append(options, promptkit.WithProfileFile(profileFile))
}
var localEndpoint string
if cfg.LocalBackend != nil {
localBackend := *cfg.LocalBackend
localBackend.Endpoint = strings.TrimSpace(localBackend.Endpoint)
localEndpoint = localBackend.Endpoint
options = append(options, PromptKitLocalBackendOption(localBackend))
}
options = append(options, cfg.EngineOptions...)
@@ -99,6 +102,7 @@ func NewPromptKitClient(cfg PromptKitClientConfig) (*PromptKitClient, error) {
recorder: recorder,
profileDir: strings.TrimSpace(cfg.ProfileDir),
profileFile: strings.TrimSpace(cfg.ProfileFile),
localEndpoint: localEndpoint,
reasoningEffort: reasoningEffort,
}, nil
}
@@ -317,7 +321,11 @@ func (c *PromptKitClient) LLMCheckpointFingerprints() ([]CheckpointFingerprint,
if err != nil {
return nil, err
}
return []CheckpointFingerprint{fingerprint}, nil
fingerprints := []CheckpointFingerprint{fingerprint}
if c.localEndpoint != "" {
fingerprints = append(fingerprints, promptKitLocalBackendFingerprint(c.localEndpoint))
}
return fingerprints, nil
}
func NewLLMProfileRecorder() *LLMProfileRecorder {