Add the Rakestrawhome Gemma profile
This commit is contained in:
@@ -195,6 +195,8 @@ The stage is complete when the new ID resolves through the embedded catalog and
|
|||||||
ordinary engine assembly, contains no unintended request defaults, and does
|
ordinary engine assembly, contains no unintended request defaults, and does
|
||||||
not alter the existing OpenRouter Gemma profile.
|
not alter the existing OpenRouter Gemma profile.
|
||||||
|
|
||||||
|
**Status:** Complete.
|
||||||
|
|
||||||
## Stage 3: Update Canonical Documentation and Complete Validation
|
## Stage 3: Update Canonical Documentation and Complete Validation
|
||||||
|
|
||||||
### Objective
|
### Objective
|
||||||
|
|||||||
@@ -1492,7 +1492,35 @@ func TestSelectedProfileRepositoryReadFailureMapsToProfileLoad(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPrepareUsesBuiltInProfileWithoutProfileDir(t *testing.T) {
|
func TestPrepareUsesBuiltInProfileWithoutProfileDir(t *testing.T) {
|
||||||
t.Setenv("OPENROUTER_API_KEY", "test-key")
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
profileID string
|
||||||
|
backendID string
|
||||||
|
endpoint string
|
||||||
|
apiKeyEnv string
|
||||||
|
model string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "OpenRouter",
|
||||||
|
profileID: "mistral-small-3",
|
||||||
|
backendID: promptkit.BackendOpenRouter,
|
||||||
|
endpoint: "https://openrouter.ai/api/v1",
|
||||||
|
apiKeyEnv: "OPENROUTER_API_KEY",
|
||||||
|
model: "mistralai/mistral-small-3.2-24b-instruct",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Rakestrawhome",
|
||||||
|
profileID: "rakestrawhome-gemma-4-31b",
|
||||||
|
backendID: promptkit.BackendRakestrawHome,
|
||||||
|
endpoint: "https://inference.ai.rakestrawhome.com/v1",
|
||||||
|
apiKeyEnv: "RAKESTRAWHOME_INFERENCE_API_KEY",
|
||||||
|
model: "google/gemma-4-31b-it",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range tests {
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
t.Setenv(tc.apiKeyEnv, "test-key")
|
||||||
engine, err := promptkit.NewEngine(promptkit.Config{
|
engine, err := promptkit.NewEngine(promptkit.Config{
|
||||||
PromptDir: frameworkPromptDir,
|
PromptDir: frameworkPromptDir,
|
||||||
SchemaDir: frameworkSchemaDir,
|
SchemaDir: frameworkSchemaDir,
|
||||||
@@ -1503,7 +1531,7 @@ func TestPrepareUsesBuiltInProfileWithoutProfileDir(t *testing.T) {
|
|||||||
|
|
||||||
prepared, err := engine.Prepare(context.Background(), promptkit.RunRequest{
|
prepared, err := engine.Prepare(context.Background(), promptkit.RunRequest{
|
||||||
PromptID: frameworkMarkdownSummaryPromptID,
|
PromptID: frameworkMarkdownSummaryPromptID,
|
||||||
ProfileID: "mistral-small-3",
|
ProfileID: tc.profileID,
|
||||||
Inputs: map[string]promptkit.ArtifactRef{
|
Inputs: map[string]promptkit.ArtifactRef{
|
||||||
"transcript": promptkit.Inline("Rin opens the gate."),
|
"transcript": promptkit.Inline("Rin opens the gate."),
|
||||||
"glossary": promptkit.Inline("gate: A guarded passage."),
|
"glossary": promptkit.Inline("gate: A guarded passage."),
|
||||||
@@ -1512,23 +1540,15 @@ func TestPrepareUsesBuiltInProfileWithoutProfileDir(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("expected built-in profile prepare to succeed, got %v", err)
|
t.Fatalf("expected built-in profile prepare to succeed, got %v", err)
|
||||||
}
|
}
|
||||||
if prepared.SelectedProfileID != "mistral-small-3" {
|
if prepared.SelectedProfileID != tc.profileID ||
|
||||||
t.Fatalf("unexpected selected profile: %q", prepared.SelectedProfileID)
|
prepared.SelectedBackendID != tc.backendID ||
|
||||||
|
prepared.EffectiveModelParams.BackendID != tc.backendID ||
|
||||||
|
prepared.EffectiveModelParams.Endpoint != tc.endpoint ||
|
||||||
|
prepared.EffectiveModelParams.APIKeyEnv != tc.apiKeyEnv ||
|
||||||
|
prepared.EffectiveModelParams.Model != tc.model {
|
||||||
|
t.Fatalf("unexpected built-in preparation: %#v", prepared)
|
||||||
}
|
}
|
||||||
if prepared.SelectedBackendID != promptkit.BackendOpenRouter {
|
})
|
||||||
t.Fatalf("unexpected selected backend: %q", prepared.SelectedBackendID)
|
|
||||||
}
|
|
||||||
if prepared.EffectiveModelParams.BackendID != promptkit.BackendOpenRouter {
|
|
||||||
t.Fatalf("unexpected effective backend: %q", prepared.EffectiveModelParams.BackendID)
|
|
||||||
}
|
|
||||||
if prepared.EffectiveModelParams.Endpoint != "https://openrouter.ai/api/v1" {
|
|
||||||
t.Fatalf("unexpected built-in endpoint: %q", prepared.EffectiveModelParams.Endpoint)
|
|
||||||
}
|
|
||||||
if prepared.EffectiveModelParams.APIKeyEnv != "OPENROUTER_API_KEY" {
|
|
||||||
t.Fatalf("unexpected built-in api key environment name: %q", prepared.EffectiveModelParams.APIKeyEnv)
|
|
||||||
}
|
|
||||||
if prepared.EffectiveModelParams.Model != "mistralai/mistral-small-3.2-24b-instruct" {
|
|
||||||
t.Fatalf("unexpected built-in model: %q", prepared.EffectiveModelParams.Model)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
id: rakestrawhome-gemma-4-31b
|
||||||
|
backend: rakestrawhome
|
||||||
|
model: google/gemma-4-31b-it
|
||||||
@@ -26,8 +26,8 @@ func TestBuiltInProfilesValidateThroughRepository(t *testing.T) {
|
|||||||
if p.ID != id {
|
if p.ID != id {
|
||||||
t.Fatalf("expected profile id %q, got %q", id, p.ID)
|
t.Fatalf("expected profile id %q, got %q", id, p.ID)
|
||||||
}
|
}
|
||||||
if p.BackendID != backend.OpenRouterID {
|
if !builtInBackendIDs[p.BackendID] {
|
||||||
t.Fatalf("expected profile %q to select %q, got %q", id, backend.OpenRouterID, p.BackendID)
|
t.Fatalf("expected profile %q to select a maintained built-in, got %q", id, p.BackendID)
|
||||||
}
|
}
|
||||||
if p.Endpoint != "" || p.APIKeyEnv != "" {
|
if p.Endpoint != "" || p.APIKeyEnv != "" {
|
||||||
t.Fatalf("expected profile %q to inherit backend connection settings, got endpoint=%q api_key_env=%q", id, p.Endpoint, p.APIKeyEnv)
|
t.Fatalf("expected profile %q to inherit backend connection settings, got endpoint=%q api_key_env=%q", id, p.Endpoint, p.APIKeyEnv)
|
||||||
@@ -40,6 +40,33 @@ func TestBuiltInProfilesDoNotContainDuplicateIDsOrRawAPIKeys(t *testing.T) {
|
|||||||
loadBuiltInProfileIDs(t)
|
loadBuiltInProfileIDs(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRakestrawhomeGemmaProfileUsesNativeDefaults(t *testing.T) {
|
||||||
|
p, err := NewRepository().GetProfile(context.Background(), "rakestrawhome-gemma-4-31b")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("load Rakestrawhome Gemma profile: %v", err)
|
||||||
|
}
|
||||||
|
if p.ID != "rakestrawhome-gemma-4-31b" ||
|
||||||
|
p.BackendID != backend.RakestrawHomeID ||
|
||||||
|
p.Model != "google/gemma-4-31b-it" ||
|
||||||
|
p.Endpoint != "" ||
|
||||||
|
p.Temperature != 0 ||
|
||||||
|
p.MaxTokens != 0 ||
|
||||||
|
p.TopP != 0 ||
|
||||||
|
p.TimeoutSeconds != 0 ||
|
||||||
|
p.ServiceTier != "" ||
|
||||||
|
p.ReasoningEffort != "" ||
|
||||||
|
p.APIKeyEnv != "" ||
|
||||||
|
p.APIKeyRequired ||
|
||||||
|
p.ExtraParams != nil {
|
||||||
|
t.Fatalf("unexpected Rakestrawhome Gemma profile: %#v", p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var builtInBackendIDs = map[string]bool{
|
||||||
|
backend.OpenRouterID: true,
|
||||||
|
backend.RakestrawHomeID: true,
|
||||||
|
}
|
||||||
|
|
||||||
func loadBuiltInProfileIDs(t *testing.T) map[string]string {
|
func loadBuiltInProfileIDs(t *testing.T) map[string]string {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
@@ -64,8 +91,9 @@ func loadBuiltInProfileIDs(t *testing.T) map[string]string {
|
|||||||
if _, ok := raw["api_key"]; ok {
|
if _, ok := raw["api_key"]; ok {
|
||||||
t.Fatalf("built-in profile %s contains raw api_key", name)
|
t.Fatalf("built-in profile %s contains raw api_key", name)
|
||||||
}
|
}
|
||||||
if raw["backend"] != backend.OpenRouterID {
|
backendID, ok := raw["backend"].(string)
|
||||||
t.Fatalf("built-in profile %s does not select %q", name, backend.OpenRouterID)
|
if !ok || !builtInBackendIDs[backendID] {
|
||||||
|
t.Fatalf("built-in profile %s does not select a maintained built-in: %#v", name, raw["backend"])
|
||||||
}
|
}
|
||||||
if _, ok := raw["endpoint"]; ok {
|
if _, ok := raw["endpoint"]; ok {
|
||||||
t.Fatalf("built-in profile %s repeats endpoint", name)
|
t.Fatalf("built-in profile %s repeats endpoint", name)
|
||||||
|
|||||||
Reference in New Issue
Block a user