Publish effective LLM backend provenance
This commit is contained in:
@@ -832,14 +832,18 @@ func mergeLLMProfileManifests(sources ...[]artifacts.LLMProfileManifest) []artif
|
||||
id := strings.TrimSpace(profile.ID)
|
||||
provider := strings.TrimSpace(profile.Provider)
|
||||
model := strings.TrimSpace(profile.Model)
|
||||
key := id + "\x00" + provider + "\x00" + model
|
||||
backendID := strings.TrimSpace(profile.BackendID)
|
||||
reasoningEffort := strings.TrimSpace(profile.ReasoningEffort)
|
||||
key := id + "\x00" + provider + "\x00" + model + "\x00" + backendID + "\x00" + reasoningEffort
|
||||
if _, exists := merged[key]; exists {
|
||||
continue
|
||||
}
|
||||
merged[key] = artifacts.LLMProfileManifest{
|
||||
ID: id,
|
||||
Provider: provider,
|
||||
Model: model,
|
||||
ID: id,
|
||||
Provider: provider,
|
||||
Model: model,
|
||||
BackendID: backendID,
|
||||
ReasoningEffort: reasoningEffort,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
internal/framework/pipeline/runner_manifest_test.go
Normal file
29
internal/framework/pipeline/runner_manifest_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package pipeline
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/core/artifacts"
|
||||
)
|
||||
|
||||
func TestMergeLLMProfileManifestsDistinguishesEffectiveTargets(t *testing.T) {
|
||||
got := mergeLLMProfileManifests(
|
||||
[]artifacts.LLMProfileManifest{
|
||||
{ID: "profile", Provider: "promptkit", Model: "model", BackendID: "backend-b", ReasoningEffort: "low"},
|
||||
{ID: " profile ", Provider: " promptkit ", Model: " model ", BackendID: " backend-a ", ReasoningEffort: " low "},
|
||||
},
|
||||
[]artifacts.LLMProfileManifest{
|
||||
{ID: "profile", Provider: "promptkit", Model: "model", BackendID: "backend-a", ReasoningEffort: "high"},
|
||||
{ID: "profile", Provider: "promptkit", Model: "model", BackendID: "backend-a", ReasoningEffort: "low"},
|
||||
},
|
||||
)
|
||||
want := []artifacts.LLMProfileManifest{
|
||||
{ID: "profile", Provider: "promptkit", Model: "model", BackendID: "backend-a", ReasoningEffort: "high"},
|
||||
{ID: "profile", Provider: "promptkit", Model: "model", BackendID: "backend-a", ReasoningEffort: "low"},
|
||||
{ID: "profile", Provider: "promptkit", Model: "model", BackendID: "backend-b", ReasoningEffort: "low"},
|
||||
}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("merged profiles = %#v, want %#v", got, want)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user