Repository navigation
feat: add DB-backed model registry - #203
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
…ntain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfdd251317
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the latest Codex review in 7bb75bf. Fixed:
Validation rerun:
|
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bb75bf97d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the latest Codex finding in fd79e1d. Fixed:
Validation rerun:
|
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
|
Claude finished @Gajesh2007's task in 7m 44s —— View job Claude's PR Review
PR Review: feat: add DB-backed model registry (current HEAD:
|
| Issue | Status |
|---|---|
SHA-256 verified on .part file before atomic rename (ModelCatalog.swift:676-683) |
✅ Fixed |
Staging downloads in .local-staging-{UUID} before replacing snapshots/local |
✅ Fixed |
| Bounded 8-worker pool for HEAD verification (channel-based, not O(n) goroutines) | ✅ Fixed |
404 vs 500 distinction in admin action handlers (writeModelRegistryStoreError) |
✅ Fixed |
Publishing key DB failures return 500 not 401 (FindPublishingAPIKeysWithError) |
✅ Fixed |
Status preserved on upsert (status excluded from ON CONFLICT UPDATE clause) |
✅ Fixed |
Case-insensitive path collision detection (strings.ToLower in seenPaths map) |
✅ Fixed |
loadModelRegistryFiles checks rows.Err() after iteration |
✅ Fixed |
ListActiveModelRegistryWithError propagates errors; catalog sync failures preserve existing catalog |
✅ Fixed |
| Provider model inventories preserved across catalog updates (fd79e1d) | ✅ Fixed |
| Aggregate SHA-256 recomputed from per-file hashes during registration | ✅ Fixed |
publish-model.sh uses Python ThreadPool, not xargs sh -c |
✅ Fixed |
Remaining Issues
P2 — GET /v1/models/catalog/{id} returns 404 for deprecated/retired models
GetModelRegistryRecord uses activeModelRegistryQuery which filters mr.status IN ('active', 'beta') (postgres_model_registry.go:273-283). Querying a deprecated model returns pgx.ErrNoRows, which maps to "model not found" (line 197) — the same 404 as a nonexistent model. Operators debugging why a model disappeared from routing have no way to distinguish "this model ID doesn't exist" from "this model exists but is deprecated." Consider adding a separate GetModelRegistryRecordAny query that doesn't filter by status for the catalog item endpoint.
P2 — SyncModelCatalog failure after successful registration not surfaced to caller
handleRegisterModel (model_registry_handlers.go:152) calls s.SyncModelCatalog() and returns 200 OK regardless of whether the catalog sync succeeded. If the DB becomes unavailable between SetModelVersion and SyncModelCatalog, the response says "registered" but providers won't route to the model until the next manual sync or restart. This is logged but invisible to the caller.
This is a known trade-off in distributed systems, but worth documenting — the 200 response guarantees storage, not routing availability. The existing SyncModelCatalog error logging helps incident response.
P2 — PromoteModelVersion doesn't check version status before promoting
postgres_model_registry.go:112-138: The SQL queries for the version ID and inserts into model_active_versions without verifying the version has status = 'ready'. In practice, SetModelVersion always writes status = 'ready', but if a version were later retired via a direct SQL operation, it could still be promoted. Consider adding AND status = 'ready' to the SELECT at line 123.
P2 — verifyManifestFiles HEAD requests have no retry
model_registry_handlers.go:480-519: A transient network failure or R2 eventual consistency lag on a single file will cause the entire registration to fail with no retry. A missing Content-Length already logs a warning (line 542) but network errors propagate immediately. Consider wrapping verifyManifestFileHEAD in a simple 3-attempt retry with exponential backoff for transient errors (5xx/network), similar to the Swift downloader's retry loop.
P3 — validRegistryIdentifier has no max-length check
model_registry_handlers.go:423-437: Model IDs and versions can be arbitrarily long. An ID of 10,000 characters would pass validation and generate a slug+hash prefix like v2/aaaa...--deadbeef012/version, which may exceed R2 object key limits (1024 bytes) or DB column widths. A len(value) > 255 (or similar) guard is cheap to add.
P3 — unmarshalMetadata silently drops corrupted JSON
postgres_model_registry.go:344-352: When a runtime_parameters or metadata column contains invalid JSON (e.g., from a direct DB edit), unmarshalMetadata returns an empty map without logging the error. The model appears to have no metadata/parameters. Consider logging the error at WARN level so corrupted rows are observable in production without failing the request.
P3 — constantTimeStringEqual leaks key length via early exit
model_registry_handlers.go:640-645: The function returns false immediately on length mismatch, leaking the expected key length to a timing side channel. For publishing API keys this is low risk (they're not authentication secrets in the same way as passwords), and subtle.ConstantTimeCompare handles the same-length case correctly. Worth noting for completeness — it's acceptable as-is but could be upgraded to always call ConstantTimeCompare on a fixed-length hash instead.
Swift Provider — Download Path
The staged-download and hash-before-rename pattern is now correct. A few observations:
P3 — publishStagedSnapshot TOCTOU is acceptable
ModelCatalog.swift:716-723: The fileExists → replaceItemAt sequence has a tiny TOCTOU window. If cacheDir is deleted between the two calls, replaceItemAt throws, completed stays false, and the defer cleans up the staging dir. The existing model is preserved on error. This is acceptable; the caller retries the full download on next invocation.
P3 — Orphaned .local-staging-* dirs on crash
If the process crashes after stagingDir is created (line 426) but before completed = true (line 469), the staging dir is orphaned in snapshotsDir. These accumulate silently. Consider adding startup cleanup of stale .local-staging-* dirs older than a configurable TTL (e.g., 24h).
Test Coverage
The test suite is thorough for the key invariants:
TestRegisterModelHandlerPromotesActiveRecord: end-to-end via httptest with a real CDN mock ✓TestModelCatalogFallbackAndRegistryPreference: registry preference over legacy catalog ✓TestModelRegistryListErrorSurfacesAndDoesNotFallback: DB failures return 500, catalog preserved ✓TestPublishingAPIKeyStoreErrorSurfacesButBootstrapStillWorks: 500 on DB error, bootstrap bypass ✓TestRegisteringNewVersionPreservesRetiredStatus: lifecycle status preserved on re-registration ✓TestUpsertModelRegistryEntryPreservesExistingStatus: upsert doesn't reset status ✓TestModelRegistryNotFoundClassification: 404 vs 500 discrimination ✓TestValidateModelManifestRejectsTraversalAndBadHashes: all edge cases including case-insensitive paths ✓
One gap: There's no test for the GET /v1/models/catalog/{id} endpoint returning 404 vs 200 for deprecated models — but this is the P2 issue noted above, so the test absence is consistent with the behavior being untested by design.
Verdict: LGTM with minor issues
The four previous review rounds have addressed all critical and important findings. The remaining P2 items (GetModelRegistryRecord 404 for deprecated models, HEAD verification retry, promote status check) are real but low-risk in production given current usage patterns. The P3 items are cosmetic or defensive-depth additions.
The bounded worker pool, aggregate hash recomputation, staged snapshot, disk space pre-check, error code taxonomy, status preservation, and provider inventory preservation are all correctly implemented and tested. The PR is in mergeable shape.
Benchmark ResultsRunner: 1-provider-streaming1 providers, 1 users, 30 requests, concurrency=5, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-non-streaming1 providers, 1 users, 20 requests, concurrency=5, streaming=false
Latency Decomposition
Assertion Report: PASS
7-provider-multi-model7 providers, 5 users, 50 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-high-concurrency3 providers, 10 users, 60 requests, concurrency=20, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-queue-saturation1 providers, 10 users, 40 requests, concurrency=15, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-20-users3 providers, 20 users, 60 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
1-provider-scaling1 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-scaling3 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
5-provider-scaling5 providers, 5 users, 30 requests, concurrency=10, streaming=true
Latency Decomposition
Assertion Report: PASS
3-provider-heavy-100conc-10kb3 providers, 20 users, 100 requests, concurrency=100, streaming=true
Latency Decomposition
Assertion Report: FAIL
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2c29ec2ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if resp.ContentLength >= 0 && resp.ContentLength != file.SizeBytes { | ||
| return fmt.Errorf("HEAD %s content length %d != manifest size %d", file.Path, resp.ContentLength, file.SizeBytes) | ||
| } |
There was a problem hiding this comment.
Verify remote file digests during registration
verifyManifestFileHEAD only checks HTTP success and Content-Length, so registration can accept artifacts whose bytes do not match manifest.files[].sha256 (for example, a corrupted or overwritten object with the same size). In that case the version is stored/promotable as ready, but providers will later fail SHA/aggregate verification at download time, leaving a catalog entry that cannot be deployed.
Useful? React with 👍 / 👎.
| catalogModels := s.store.ListSupportedModels() | ||
| catalogByID = make(map[string]store.SupportedModel, len(catalogModels)) | ||
| for _, cm := range catalogModels { |
There was a problem hiding this comment.
Enforce empty catalog as deny-all in model listing
When ListActiveModelRegistryWithError() returns no rows and legacy supported_models is also empty (fresh DB state), catalogByID stays empty in this fallback branch. Because filtering later only excludes non-catalog models when len(catalogByID) > 0, /v1/models can still return provider-advertised models even though routing is deny-all, which misleads clients into selecting models that are not actually routable.
Useful? React with 👍 / 👎.
| trap 'rm -f "$MANIFEST"' EXIT | ||
|
|
||
| printf 'Hashing model into manifest...\n' | ||
| (cd "$ROOT_DIR/provider-swift" && swift run -c release darkbloom-publish hash "$MODEL_DIR" --id "$MODEL_ID" --version "$VERSION" -o "$MANIFEST") |
There was a problem hiding this comment.
Resolve model directory before changing working directory
The script validates MODEL_DIR before changing directories, but the hashing step runs inside provider-swift and reuses the raw MODEL_DIR string. If the operator enters a relative path (for example ./snapshot), validation can pass in the caller’s cwd and then fail at swift run ... hash because the same relative path is interpreted from provider-swift, breaking the publish flow for otherwise valid inputs.
Useful? React with 👍 / 👎.
Summary
This PR replaces the hardcoded model catalog with a DB-backed, versioned model registry backed by R2 manifests.
darkbloom-publish hashfor Linux/GCP model manifest generation.scripts/publish-model.shfor uploading local Hugging Face snapshots todarkbloom-modelsand.github/workflows/register-model.ymlfor registering those manifests with the coordinator.https://models.darkbloom.ai, fetch manifests, download files with bounded 8-way parallelism, and verify per-file + aggregate SHA-256.Before
flowchart LR subgraph Before["Before: hardcoded registry + manual R2"] A["Coordinator startup"] --> B["seedModelCatalog hardcodes 5 models"] B --> C["supported_models table"] C --> D["/v1/models/catalog"] E["Rust provider fallback catalog"] -. drift .-> D F["Console UI hardcoded copies"] -. drift .-> D G["Manual out-of-band R2 upload"] --> H["pub-r2.dev/{s3_name}/files"] D --> I["Provider downloads fixed file list"] H --> I I --> J["Sequential downloads; limited hash coverage"] endAfter
flowchart LR subgraph Publish["Publish path"] A["GCP VM with local HuggingFace snapshot"] --> B["darkbloom-publish hash"] B --> C["manifest.json: files, sizes, SHA-256, aggregate"] B --> D["scripts/publish-model.sh"] D --> E["R2 darkbloom-models via AWS CLI"] C --> E E --> F["models.darkbloom.ai/v2/{model-slug--hash}/{version}"] end subgraph Register["Registration path"] G["GitHub workflow: register-model.yml"] --> H["POST /v1/admin/models/register"] H --> I["Dedicated publishing API key auth"] H --> J["Coordinator fetches manifest"] J --> K["Parallel HEAD verification"] K --> L["Postgres model_registry + versions + files"] H --> M{"promote?"} M -->|yes| N["model_active_versions"] end subgraph Serve["Runtime path"] L --> O["/v1/models/catalog"] N --> O O --> P["Swift provider fetches manifest"] F --> Q["8-way parallel downloads"] P --> Q Q --> R["Per-file SHA-256 + aggregate verification"] R --> S["Provider serves active model"] endValidation
go test ./coordinator/...cd provider-swift && swift build --product darkbloom-publishcd provider-swift && swift test --filter ProviderCoreFoundationTestscd provider-swift && swift test --filter ModelCatalogTestscd provider-swift && swift buildbash -n scripts/publish-model.shcd console-ui && npm ci && npx eslint src/ && npm run build(0 errors, existing warnings)@mermaid-js/mermaid-cli.Local Hugging Face smoke tests:
models--gpt2: aggregate4aba3d1525bd4ca23759e1f679356dc80112396ffa15121c82a0a1b52bc023e9mlx-community/gemma-4-26b-a4b-it-8bit: 13 files, 27,986,040,506 bytes, aggregatea4722b6020adb1894c700b45ddcd58bc0e0f033abe7139f86cbbbfe60cba4eb6, R2 prefixv2/mlx-community-gemma-4-26b-a4b-it-8bit--a69615027fc1/local-gemma4-26b-8bitKnown note: full
swift teststill hits the pre-existing MLX metallib error after non-MLX tests pass.Model Registration Fields
Required workflow inputs:
model_idversiondisplay_namequantizationmax_context_lengthmax_output_lengthmin_ram_gbOptional metadata inputs:
familyarchitecturecapabilities_csvdescriptionmetadata_jsonruntime_parameters_jsonpromotecoordinator_urlRemoved from the registration contract:
recommended_ram_gb,source_hf_id, andsource_hf_revision.Required Secrets / Env
Coordinator:
MODEL_REGISTRY_CDN_BASE_URLoptional, defaults tohttps://models.darkbloom.aiMODEL_REGISTRY_PUBLISHING_KEYbootstrap publishing keyGitHub Actions:
MODEL_REGISTRY_PUBLISHING_KEYGCP publish VM:
GCP_PROJECTR2_ACCOUNT_IDR2_BUCKET, defaults todarkbloom-modelsR2_ACCESS_KEY_SECRET, defaults todarkbloom-r2-access-key-idR2_SECRET_KEY_SECRET, defaults todarkbloom-r2-secret-access-key