This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
@@ -279,6 +280,7 @@ func renderCompose(installation config.Installation, fingerprint string) []byte
|
||||
return []byte(fmt.Sprintf(`services:
|
||||
core:
|
||||
environment:
|
||||
THT_HOST_PLATFORM: %s
|
||||
THT_MODEL_CATALOG_FILE: /run/thothii-model-catalog/catalog.json
|
||||
THT_MODEL_CATALOG_REVISION: %s
|
||||
THT_DEFAULT_SESSION_MODEL: %s
|
||||
@@ -306,7 +308,7 @@ func renderCompose(installation config.Installation, fingerprint string) []byte
|
||||
embedding-model-init:
|
||||
environment:
|
||||
OLLAMA_MODEL: %s
|
||||
`, strconv.Quote(fingerprint), strconv.Quote(installation.ModelCatalog.Defaults.Interaction),
|
||||
`, strconv.Quote(runtime.GOOS), strconv.Quote(fingerprint), strconv.Quote(installation.ModelCatalog.Defaults.Interaction),
|
||||
strconv.Quote(embedding.ID), strconv.Quote(embeddingModelName(embedding.ID)), strconv.Quote(strconv.Itoa(embedding.Dimensions)),
|
||||
strconv.Quote(installation.GeneratedModelCatalogPath()), strconv.Quote(installation.GeneratedPiModelsPath()),
|
||||
strconv.Quote(installation.GeneratedPiSettingsPath()), strconv.Quote(embedding.ID),
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -50,6 +51,9 @@ func TestRenderProducesDeterministicCatalogPiAndComposeProjections(t *testing.T)
|
||||
t.Fatalf("Pi projection must map canonical catalog keys to upstream model IDs")
|
||||
}
|
||||
compose := string(first[ComposeFile])
|
||||
if !strings.Contains(compose, `THT_HOST_PLATFORM: "`+runtime.GOOS+`"`) {
|
||||
t.Fatal("Compose must project the CLI host OS, not the Docker container OS")
|
||||
}
|
||||
for _, expected := range []string{"THT_MODEL_CATALOG_FILE", "THT_DEFAULT_SESSION_MODEL", "zai/glm-5.3", "THT_INTERNAL_EMBEDDING_ID", "THT_INTERNAL_EMBEDDING_MODEL", "OLLAMA_MODEL", installation.GeneratedModelCatalogPath()} {
|
||||
if !strings.Contains(compose, expected) {
|
||||
t.Fatalf("Compose projection missing %q:\n%s", expected, compose)
|
||||
|
||||
Reference in New Issue
Block a user