feat: Add Google Cloud Storage CDN for models.soulcraft.com
- Primary source: models.soulcraft.com on GCS - Backup: GitHub releases - Fallback: Hugging Face - Immutable with SHA256 verification
This commit is contained in:
parent
a9c5fd0eeb
commit
1096d285f5
13 changed files with 1058 additions and 15 deletions
34
deploy/models-cdn/wrangler.toml
Normal file
34
deploy/models-cdn/wrangler.toml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
name = "brainy-models-cdn"
|
||||
main = "src/index.ts"
|
||||
compatibility_date = "2024-01-01"
|
||||
|
||||
# Custom domain
|
||||
routes = [
|
||||
{ pattern = "models.soulcraft.com/*", zone_name = "soulcraft.com" }
|
||||
]
|
||||
|
||||
# KV namespace for model storage
|
||||
kv_namespaces = [
|
||||
{ binding = "MODELS", id = "brainy_models_kv" }
|
||||
]
|
||||
|
||||
# R2 bucket for large model files
|
||||
r2_buckets = [
|
||||
{ binding = "MODEL_BUCKET", bucket_name = "brainy-models" }
|
||||
]
|
||||
|
||||
[env.production]
|
||||
vars = { ENVIRONMENT = "production" }
|
||||
|
||||
# Cache everything for 1 year (models never change)
|
||||
[site]
|
||||
bucket = "./models"
|
||||
|
||||
[build]
|
||||
command = "npm install && npm run build"
|
||||
|
||||
# Durable Objects for download tracking
|
||||
[[durable_objects.bindings]]
|
||||
name = "DOWNLOAD_TRACKER"
|
||||
class_name = "DownloadTracker"
|
||||
script_name = "download-tracker"
|
||||
Loading…
Add table
Add a link
Reference in a new issue