{
  "manifest_version": "1.0.0",
  "template": {
    "id": "cebdf9e7-cd8a-43ed-867b-ad7c6b4afa19",
    "slug": "localai-openai-compatible-api",
    "name": "LocalAI | Private OpenAI-Compatible API",
    "description": "Self-host LocalAI on Railway, run LLMs, images, and audio locally",
    "url": "https://railway.com/deploy/localai-openai-compatible-api",
    "upstream": {
      "image": "localai/localai:latest-cpu"
    }
  },
  "services": [
    {
      "name": "LocalAI",
      "source": {
        "image": "localai/localai:latest-cpu"
      },
      "needs_volume": true,
      "volume_mount_path": "/models",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "LocalAI",
      "description": "HTTP server listening port",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "THREADS",
      "service": "LocalAI",
      "description": "CPU threads for inference",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "CONTEXT_SIZE",
      "service": "LocalAI",
      "description": "Default model context window",
      "secret": false,
      "strategy": "default",
      "default": "512"
    },
    {
      "key": "LOCALAI_API_KEY",
      "service": "LocalAI",
      "description": "API key for web UI and API auth",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "LocalAI",
      "description": "Run as root for volume permissions",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "LOCALAI_MODELS_PATH",
      "service": "LocalAI",
      "description": "Model storage directory path",
      "secret": false,
      "strategy": "default",
      "default": "/models"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "localai-openai-compatible-api"
      }
    },
    "cli": "railway deploy --template localai-openai-compatible-api",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "cebdf9e7-cd8a-43ed-867b-ad7c6b4afa19",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "71f6bd7f-30f2-43fe-9ee0-9e5509d1278e": {
                  "icon": "https://raw.githubusercontent.com/mudler/LocalAI/master/core/http/static/favicon.svg",
                  "name": "LocalAI",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "localai/localai:latest-cpu"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP server listening port",
                      "defaultValue": "8080"
                    },
                    "THREADS": {
                      "isOptional": false,
                      "description": "CPU threads for inference",
                      "defaultValue": "2"
                    },
                    "CONTEXT_SIZE": {
                      "isOptional": false,
                      "description": "Default model context window",
                      "defaultValue": "512"
                    },
                    "LOCALAI_API_KEY": {
                      "isOptional": false,
                      "description": "API key for web UI and API auth",
                      "defaultValue": "{{LOCALAI_API_KEY}}"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Run as root for volume permissions",
                      "defaultValue": "0"
                    },
                    "LOCALAI_MODELS_PATH": {
                      "isOptional": false,
                      "description": "Model storage directory path",
                      "defaultValue": "/models"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "71f6bd7f-30f2-43fe-9ee0-9e5509d1278e": {
                      "mountPath": "/models"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T22:14:44.200Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T13:19:33.041Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_e4dc00d3891c4585aa6d",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 57,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "LocalAI"
  }
}
