{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0db4ac87-7d89-456b-a938-5c26589035f3",
    "slug": "kokoro-tts",
    "name": "Kokoro-TTS",
    "description": "Turns written text into natural-sounding speech, in 60+ voices",
    "url": "https://railway.com/deploy/kokoro-tts",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/kokoro-tts-railway"
    }
  },
  "services": [
    {
      "name": "gateway",
      "source": {
        "repo": "https://github.com/gridalpha/kokoro-tts-railway"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "kokoro",
      "source": {
        "image": "ghcr.io/remsky/kokoro-fastapi-cpu:latest"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "gateway",
      "description": "Port Caddy binds for public traffic",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "KOKORO_API_KEY",
      "service": "gateway",
      "description": "Bearer token for the OpenAI-compatible API",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "KOKORO_PASSWORD",
      "service": "gateway",
      "description": "Basic-auth password for the web player",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "KOKORO_UPSTREAM",
      "service": "gateway",
      "description": "Private address of the inference service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "KOKORO_USERNAME",
      "service": "gateway",
      "description": "Basic-auth user for the web player",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "gateway",
      "description": "Dockerfile location in the source repo",
      "secret": false,
      "strategy": "default",
      "default": "Dockerfile"
    },
    {
      "key": "PORT",
      "service": "kokoro",
      "description": "Port Railway probes; the app hardcodes 8880",
      "secret": false,
      "strategy": "default",
      "default": "8880"
    },
    {
      "key": "USE_GPU",
      "service": "kokoro",
      "description": "CPU inference only",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "DEVICE_TYPE",
      "service": "kokoro",
      "description": "Skips MPS and CUDA auto-detection",
      "secret": false,
      "strategy": "default",
      "default": "cpu"
    },
    {
      "key": "ENABLE_SSML",
      "service": "kokoro",
      "description": "SSML translation and SSML routes",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "API_LOG_LEVEL",
      "service": "kokoro",
      "description": "Log verbosity, upstream default is DEBUG",
      "secret": false,
      "strategy": "default",
      "default": "INFO"
    },
    {
      "key": "DEFAULT_VOICE",
      "service": "kokoro",
      "description": "Voice used when a request names none",
      "secret": false,
      "strategy": "default",
      "default": "af_heart"
    },
    {
      "key": "ALLOW_DEV_UNLOAD",
      "service": "kokoro",
      "description": "Keeps the model unload route off",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "ENABLE_VOICE_TAGS",
      "service": "kokoro",
      "description": "Inline [voice:name] multi-speaker parsing",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "ENABLE_WEB_PLAYER",
      "service": "kokoro",
      "description": "Serves the browser player at /web/",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "ENABLE_DEBUG_ENDPOINTS",
      "service": "kokoro",
      "description": "Keeps host introspection routes off",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "ALLOW_LOCAL_VOICE_SAVING",
      "service": "kokoro",
      "description": "Writing blended voices would need a volume",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "kokoro",
      "description": "Lets in-flight audio finish on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "kokoro-tts"
      }
    },
    "cli": "railway deploy --template kokoro-tts",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0db4ac87-7d89-456b-a938-5c26589035f3",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "4bc99f88-dcef-4b32-b642-e2b82e4a86a0": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/caddy.svg",
                  "name": "gateway",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/kokoro-tts-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Caddy binds for public traffic",
                      "defaultValue": "8080"
                    },
                    "KOKORO_API_KEY": {
                      "isOptional": false,
                      "description": "Bearer token for the OpenAI-compatible API",
                      "defaultValue": "{{KOKORO_API_KEY}}"
                    },
                    "KOKORO_PASSWORD": {
                      "isOptional": false,
                      "description": "Basic-auth password for the web player",
                      "defaultValue": "{{KOKORO_PASSWORD}}"
                    },
                    "KOKORO_UPSTREAM": {
                      "isOptional": false,
                      "description": "Private address of the inference service",
                      "defaultValue": "${{kokoro.RAILWAY_PRIVATE_DOMAIN}}:8880"
                    },
                    "KOKORO_USERNAME": {
                      "isOptional": false,
                      "description": "Basic-auth user for the web player",
                      "defaultValue": "admin"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Dockerfile location in the source repo",
                      "defaultValue": "Dockerfile"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "e94f569b-f94a-4603-bae3-6c4cb8cfae85": {
                  "icon": "https://raw.githubusercontent.com/remsky/Kokoro-FastAPI/master/web/favicon.svg",
                  "name": "kokoro",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'read -r q p < /sys/fs/cgroup/cpu.max || true; case \"$q\" in \"\"|max) C=8;; *) C=$((q/p));; esac; [ \"${C:-0}\" -lt 1 ] && C=1; export OMP_NUM_THREADS=$C MKL_NUM_THREADS=$C OPENBLAS_NUM_THREADS=$C NUMEXPR_NUM_THREADS=$C; echo \"kokoro: cgroup cpu quota -> OMP_NUM_THREADS=$C\"; exec ./entrypoint.sh'",
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/remsky/kokoro-fastapi-cpu:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway probes; the app hardcodes 8880",
                      "defaultValue": "8880"
                    },
                    "USE_GPU": {
                      "isOptional": false,
                      "description": "CPU inference only",
                      "defaultValue": "false"
                    },
                    "DEVICE_TYPE": {
                      "isOptional": false,
                      "description": "Skips MPS and CUDA auto-detection",
                      "defaultValue": "cpu"
                    },
                    "ENABLE_SSML": {
                      "isOptional": false,
                      "description": "SSML translation and SSML routes",
                      "defaultValue": "true"
                    },
                    "API_LOG_LEVEL": {
                      "isOptional": false,
                      "description": "Log verbosity, upstream default is DEBUG",
                      "defaultValue": "INFO"
                    },
                    "DEFAULT_VOICE": {
                      "isOptional": false,
                      "description": "Voice used when a request names none",
                      "defaultValue": "af_heart"
                    },
                    "ALLOW_DEV_UNLOAD": {
                      "isOptional": false,
                      "description": "Keeps the model unload route off",
                      "defaultValue": "false"
                    },
                    "ENABLE_VOICE_TAGS": {
                      "isOptional": false,
                      "description": "Inline [voice:name] multi-speaker parsing",
                      "defaultValue": "true"
                    },
                    "ENABLE_WEB_PLAYER": {
                      "isOptional": false,
                      "description": "Serves the browser player at /web/",
                      "defaultValue": "true"
                    },
                    "ENABLE_DEBUG_ENDPOINTS": {
                      "isOptional": false,
                      "description": "Keeps host introspection routes off",
                      "defaultValue": "false"
                    },
                    "ALLOW_LOCAL_VOICE_SAVING": {
                      "isOptional": false,
                      "description": "Writing blended voices would need a volume",
                      "defaultValue": "false"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Lets in-flight audio finish on redeploy",
                      "defaultValue": "30"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "gateway",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": false
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-19T15:43:46.808Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_ceabed366e354b7db918",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 65,
    "typical_build_seconds": 10,
    "typical_start_seconds": 10,
    "slowest_service": "gateway"
  }
}
