{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f2d936d1-332b-4220-8030-66e12e6ad8b8",
    "slug": "lightrag-rag",
    "name": "LightRAG",
    "description": "Turns your documents into a searchable knowledge graph you can query",
    "url": "https://railway.com/deploy/lightrag-rag",
    "upstream": {
      "image": "ghcr.io/hkuds/lightrag:latest"
    }
  },
  "services": [
    {
      "name": "lightrag",
      "source": {
        "image": "ghcr.io/hkuds/lightrag:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/storage",
      "http": true
    },
    {
      "name": "ollama",
      "source": {
        "image": "ollama/ollama:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/root/.ollama",
      "http": false
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "HOST",
      "service": "lightrag",
      "description": "Bind address inside the container",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "PORT",
      "service": "lightrag",
      "description": "HTTP server listening port",
      "secret": false,
      "strategy": "default",
      "default": "9621"
    },
    {
      "key": "TOP_K",
      "service": "lightrag",
      "description": "Graph entities retrieved per query",
      "secret": false,
      "strategy": "default",
      "default": "20"
    },
    {
      "key": "LOG_DIR",
      "service": "lightrag",
      "description": "Rotating log files",
      "secret": false,
      "strategy": "default",
      "default": "/app/storage/logs"
    },
    {
      "key": "TIMEOUT",
      "service": "lightrag",
      "description": "Worker request timeout",
      "secret": false,
      "strategy": "default",
      "default": "600"
    },
    {
      "key": "INPUT_DIR",
      "service": "lightrag",
      "description": "Uploaded documents on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/app/storage/inputs"
    },
    {
      "key": "LLM_MODEL",
      "service": "lightrag",
      "description": "Model used for extraction and answers",
      "secret": false,
      "strategy": "default",
      "default": "qwen2.5:3b"
    },
    {
      "key": "PROMPT_DIR",
      "service": "lightrag",
      "description": "Custom prompt profiles",
      "secret": false,
      "strategy": "default",
      "default": "/app/storage/prompts"
    },
    {
      "key": "CHUNK_TOP_K",
      "service": "lightrag",
      "description": "Text chunks retrieved per query",
      "secret": false,
      "strategy": "default",
      "default": "5"
    },
    {
      "key": "LLM_BINDING",
      "service": "lightrag",
      "description": "Language model provider",
      "secret": false,
      "strategy": "default",
      "default": "ollama"
    },
    {
      "key": "LLM_TIMEOUT",
      "service": "lightrag",
      "description": "Seconds before a model call fails",
      "secret": false,
      "strategy": "default",
      "default": "600"
    },
    {
      "key": "WEBUI_TITLE",
      "service": "lightrag",
      "description": "Title shown in the web UI",
      "secret": false,
      "strategy": "default",
      "default": "LightRAG Knowledge Graph"
    },
    {
      "key": "WORKING_DIR",
      "service": "lightrag",
      "description": "Working files on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/app/storage/rag_storage"
    },
    {
      "key": "TOKEN_SECRET",
      "service": "lightrag",
      "description": "Session token signing key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "AUTH_ACCOUNTS",
      "service": "lightrag",
      "description": "Web UI login as user:password",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "EMBEDDING_DIM",
      "service": "lightrag",
      "description": "Embedding vector width",
      "secret": false,
      "strategy": "default",
      "default": "1024"
    },
    {
      "key": "MAX_ASYNC_LLM",
      "service": "lightrag",
      "description": "Concurrent language model calls",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "lightrag",
      "description": "Private database hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_PORT",
      "service": "lightrag",
      "description": "Database port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_USER",
      "service": "lightrag",
      "description": "Database user",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "EMBEDDING_MODEL",
      "service": "lightrag",
      "description": "Embedding model",
      "secret": false,
      "strategy": "default",
      "default": "bge-m3"
    },
    {
      "key": "WHITELIST_PATHS",
      "service": "lightrag",
      "description": "Only route exempt from authentication",
      "secret": false,
      "strategy": "default",
      "default": "/health"
    },
    {
      "key": "ENABLE_LLM_CACHE",
      "service": "lightrag",
      "description": "Cache repeated model responses",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "LIGHTRAG_API_KEY",
      "service": "lightrag",
      "description": "Value clients send as X-API-Key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "LLM_BINDING_HOST",
      "service": "lightrag",
      "description": "Private model server URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MAX_TOTAL_TOKENS",
      "service": "lightrag",
      "description": "Total context budget per query",
      "secret": true,
      "strategy": "default",
      "default": "12000"
    },
    {
      "key": "SUMMARY_LANGUAGE",
      "service": "lightrag",
      "description": "Language of generated summaries",
      "secret": false,
      "strategy": "default",
      "default": "English"
    },
    {
      "key": "EMBEDDING_BINDING",
      "service": "lightrag",
      "description": "Embedding provider",
      "secret": false,
      "strategy": "default",
      "default": "ollama"
    },
    {
      "key": "EMBEDDING_TIMEOUT",
      "service": "lightrag",
      "description": "Seconds before an embedding call fails",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "MAX_ENTITY_TOKENS",
      "service": "lightrag",
      "description": "Entity share of that budget",
      "secret": true,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "POSTGRES_DATABASE",
      "service": "lightrag",
      "description": "Database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "lightrag",
      "description": "Database password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "WEBUI_DESCRIPTION",
      "service": "lightrag",
      "description": "Subtitle in the web UI",
      "secret": false,
      "strategy": "default",
      "default": "Graph-based Retrieval-Augmented Generation on Railway"
    },
    {
      "key": "OLLAMA_LLM_NUM_CTX",
      "service": "lightrag",
      "description": "Context window requested from Ollama",
      "secret": false,
      "strategy": "default",
      "default": "16384"
    },
    {
      "key": "TOKEN_EXPIRE_HOURS",
      "service": "lightrag",
      "description": "Session lifetime in hours",
      "secret": true,
      "strategy": "default",
      "default": "48"
    },
    {
      "key": "EMBEDDING_BATCH_NUM",
      "service": "lightrag",
      "description": "Chunks embedded per request",
      "secret": false,
      "strategy": "default",
      "default": "8"
    },
    {
      "key": "FORWARDED_ALLOW_IPS",
      "service": "lightrag",
      "description": "Trust proxy headers from Railway's edge",
      "secret": false,
      "strategy": "default",
      "default": "*"
    },
    {
      "key": "LIGHTRAG_KV_STORAGE",
      "service": "lightrag",
      "description": "Key-value store backend",
      "secret": false,
      "strategy": "default",
      "default": "PGKVStorage"
    },
    {
      "key": "MAX_PARALLEL_INSERT",
      "service": "lightrag",
      "description": "Documents indexed at once",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "MAX_RELATION_TOKENS",
      "service": "lightrag",
      "description": "Relation share of that budget",
      "secret": true,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "QUERY_MAX_ASYNC_LLM",
      "service": "lightrag",
      "description": "Concurrent query calls",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "SUMMARY_CONTEXT_SIZE",
      "service": "lightrag",
      "description": "Context for description summaries",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "KEYWORD_MAX_ASYNC_LLM",
      "service": "lightrag",
      "description": "Concurrent keyword-extraction calls",
      "secret": true,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "OLLAMA_LLM_NUM_THREAD",
      "service": "lightrag",
      "description": "CPU threads for generation",
      "secret": false,
      "strategy": "default",
      "default": "8"
    },
    {
      "key": "EMBEDDING_BINDING_HOST",
      "service": "lightrag",
      "description": "Private embedding server URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "LIGHTRAG_GRAPH_STORAGE",
      "service": "lightrag",
      "description": "Graph backend, plain tables",
      "secret": false,
      "strategy": "default",
      "default": "PGTableGraphStorage"
    },
    {
      "key": "LIGHTRAG_VECTOR_STORAGE",
      "service": "lightrag",
      "description": "Vector store backend",
      "secret": false,
      "strategy": "default",
      "default": "PGVectorStorage"
    },
    {
      "key": "EMBEDDING_FUNC_MAX_ASYNC",
      "service": "lightrag",
      "description": "Concurrent embedding calls",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "MAX_EXTRACT_INPUT_TOKENS",
      "service": "lightrag",
      "description": "Largest extraction input",
      "secret": true,
      "strategy": "default",
      "default": "8192"
    },
    {
      "key": "OLLAMA_EMBEDDING_NUM_CTX",
      "service": "lightrag",
      "description": "Embedding context window",
      "secret": false,
      "strategy": "default",
      "default": "8192"
    },
    {
      "key": "POSTGRES_MAX_CONNECTIONS",
      "service": "lightrag",
      "description": "Connection pool ceiling",
      "secret": false,
      "strategy": "default",
      "default": "12"
    },
    {
      "key": "ENTITY_EXTRACTION_USE_JSON",
      "service": "lightrag",
      "description": "Structured extraction output",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "POSTGRES_VECTOR_INDEX_TYPE",
      "service": "lightrag",
      "description": "pgvector index type",
      "secret": false,
      "strategy": "default",
      "default": "HNSW"
    },
    {
      "key": "LIGHTRAG_DOC_STATUS_STORAGE",
      "service": "lightrag",
      "description": "Document status backend",
      "secret": false,
      "strategy": "default",
      "default": "PGDocStatusStorage"
    },
    {
      "key": "OLLAMA_EMBEDDING_NUM_THREAD",
      "service": "lightrag",
      "description": "CPU threads for embedding",
      "secret": false,
      "strategy": "default",
      "default": "8"
    },
    {
      "key": "PORT",
      "service": "ollama",
      "description": "HTTP server listening port",
      "secret": false,
      "strategy": "default",
      "default": "11434"
    },
    {
      "key": "OLLAMA_HOST",
      "service": "ollama",
      "description": "Dual-stack bind for private networking",
      "secret": false,
      "strategy": "default",
      "default": "[::]:11434"
    },
    {
      "key": "OLLAMA_MODELS",
      "service": "ollama",
      "description": "Model directory on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/root/.ollama/models"
    },
    {
      "key": "OLLAMA_NO_CLOUD",
      "service": "ollama",
      "description": "Disable remote cloud inference",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "OLLAMA_KEEP_ALIVE",
      "service": "ollama",
      "description": "How long a model stays loaded",
      "secret": false,
      "strategy": "default",
      "default": "30m"
    },
    {
      "key": "OLLAMA_PULL_MODELS",
      "service": "ollama",
      "description": "Models pulled on first boot",
      "secret": false,
      "strategy": "default",
      "default": "qwen2.5:3b bge-m3"
    },
    {
      "key": "OLLAMA_LOAD_TIMEOUT",
      "service": "ollama",
      "description": "Model load timeout",
      "secret": false,
      "strategy": "default",
      "default": "10m"
    },
    {
      "key": "OLLAMA_NUM_PARALLEL",
      "service": "ollama",
      "description": "Concurrent requests per model",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "OLLAMA_CONTEXT_LENGTH",
      "service": "ollama",
      "description": "Default context window",
      "secret": false,
      "strategy": "default",
      "default": "16384"
    },
    {
      "key": "OLLAMA_MAX_LOADED_MODELS",
      "service": "ollama",
      "description": "Keep chat and embedding models resident",
      "secret": false,
      "strategy": "default",
      "default": "2"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Cluster location on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password, read by the image",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "lightrag-rag"
      }
    },
    "cli": "railway deploy --template lightrag-rag",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f2d936d1-332b-4220-8030-66e12e6ad8b8",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "109ec50c-e838-4ee4-a726-8cd54fec166a": {
                  "icon": "https://raw.githubusercontent.com/HKUDS/LightRAG/main/lightrag_webui/public/logo.svg",
                  "name": "lightrag",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/hkuds/lightrag:latest"
                  },
                  "variables": {
                    "HOST": {
                      "isOptional": false,
                      "description": "Bind address inside the container",
                      "defaultValue": "0.0.0.0"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP server listening port",
                      "defaultValue": "9621"
                    },
                    "TOP_K": {
                      "isOptional": false,
                      "description": "Graph entities retrieved per query",
                      "defaultValue": "20"
                    },
                    "LOG_DIR": {
                      "isOptional": false,
                      "description": "Rotating log files",
                      "defaultValue": "/app/storage/logs"
                    },
                    "TIMEOUT": {
                      "isOptional": false,
                      "description": "Worker request timeout",
                      "defaultValue": "600"
                    },
                    "INPUT_DIR": {
                      "isOptional": false,
                      "description": "Uploaded documents on the volume",
                      "defaultValue": "/app/storage/inputs"
                    },
                    "LLM_MODEL": {
                      "isOptional": false,
                      "description": "Model used for extraction and answers",
                      "defaultValue": "qwen2.5:3b"
                    },
                    "PROMPT_DIR": {
                      "isOptional": false,
                      "description": "Custom prompt profiles",
                      "defaultValue": "/app/storage/prompts"
                    },
                    "CHUNK_TOP_K": {
                      "isOptional": false,
                      "description": "Text chunks retrieved per query",
                      "defaultValue": "5"
                    },
                    "LLM_BINDING": {
                      "isOptional": false,
                      "description": "Language model provider",
                      "defaultValue": "ollama"
                    },
                    "LLM_TIMEOUT": {
                      "isOptional": false,
                      "description": "Seconds before a model call fails",
                      "defaultValue": "600"
                    },
                    "WEBUI_TITLE": {
                      "isOptional": false,
                      "description": "Title shown in the web UI",
                      "defaultValue": "LightRAG Knowledge Graph"
                    },
                    "WORKING_DIR": {
                      "isOptional": false,
                      "description": "Working files on the volume",
                      "defaultValue": "/app/storage/rag_storage"
                    },
                    "TOKEN_SECRET": {
                      "isOptional": false,
                      "description": "Session token signing key",
                      "defaultValue": "{{TOKEN_SECRET}}"
                    },
                    "AUTH_ACCOUNTS": {
                      "isOptional": false,
                      "description": "Web UI login as user:password",
                      "defaultValue": "{{AUTH_ACCOUNTS}}"
                    },
                    "EMBEDDING_DIM": {
                      "isOptional": false,
                      "description": "Embedding vector width",
                      "defaultValue": "1024"
                    },
                    "MAX_ASYNC_LLM": {
                      "isOptional": false,
                      "description": "Concurrent language model calls",
                      "defaultValue": "2"
                    },
                    "POSTGRES_HOST": {
                      "isOptional": false,
                      "description": "Private database hostname",
                      "defaultValue": "${{Postgres.PGHOST}}"
                    },
                    "POSTGRES_PORT": {
                      "isOptional": false,
                      "description": "Database port",
                      "defaultValue": "${{Postgres.PGPORT}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "EMBEDDING_MODEL": {
                      "isOptional": false,
                      "description": "Embedding model",
                      "defaultValue": "bge-m3"
                    },
                    "WHITELIST_PATHS": {
                      "isOptional": false,
                      "description": "Only route exempt from authentication",
                      "defaultValue": "/health"
                    },
                    "ENABLE_LLM_CACHE": {
                      "isOptional": false,
                      "description": "Cache repeated model responses",
                      "defaultValue": "true"
                    },
                    "LIGHTRAG_API_KEY": {
                      "isOptional": false,
                      "description": "Value clients send as X-API-Key",
                      "defaultValue": "{{LIGHTRAG_API_KEY}}"
                    },
                    "LLM_BINDING_HOST": {
                      "isOptional": false,
                      "description": "Private model server URL",
                      "defaultValue": "http://${{ollama.RAILWAY_PRIVATE_DOMAIN}}:11434"
                    },
                    "MAX_TOTAL_TOKENS": {
                      "isOptional": false,
                      "description": "Total context budget per query",
                      "defaultValue": "12000"
                    },
                    "SUMMARY_LANGUAGE": {
                      "isOptional": false,
                      "description": "Language of generated summaries",
                      "defaultValue": "English"
                    },
                    "EMBEDDING_BINDING": {
                      "isOptional": false,
                      "description": "Embedding provider",
                      "defaultValue": "ollama"
                    },
                    "EMBEDDING_TIMEOUT": {
                      "isOptional": false,
                      "description": "Seconds before an embedding call fails",
                      "defaultValue": "300"
                    },
                    "MAX_ENTITY_TOKENS": {
                      "isOptional": false,
                      "description": "Entity share of that budget",
                      "defaultValue": "3000"
                    },
                    "POSTGRES_DATABASE": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "WEBUI_DESCRIPTION": {
                      "isOptional": false,
                      "description": "Subtitle in the web UI",
                      "defaultValue": "Graph-based Retrieval-Augmented Generation on Railway"
                    },
                    "OLLAMA_LLM_NUM_CTX": {
                      "isOptional": false,
                      "description": "Context window requested from Ollama",
                      "defaultValue": "16384"
                    },
                    "TOKEN_EXPIRE_HOURS": {
                      "isOptional": false,
                      "description": "Session lifetime in hours",
                      "defaultValue": "48"
                    },
                    "EMBEDDING_BATCH_NUM": {
                      "isOptional": false,
                      "description": "Chunks embedded per request",
                      "defaultValue": "8"
                    },
                    "FORWARDED_ALLOW_IPS": {
                      "isOptional": false,
                      "description": "Trust proxy headers from Railway's edge",
                      "defaultValue": "*"
                    },
                    "LIGHTRAG_KV_STORAGE": {
                      "isOptional": false,
                      "description": "Key-value store backend",
                      "defaultValue": "PGKVStorage"
                    },
                    "MAX_PARALLEL_INSERT": {
                      "isOptional": false,
                      "description": "Documents indexed at once",
                      "defaultValue": "2"
                    },
                    "MAX_RELATION_TOKENS": {
                      "isOptional": false,
                      "description": "Relation share of that budget",
                      "defaultValue": "3000"
                    },
                    "QUERY_MAX_ASYNC_LLM": {
                      "isOptional": false,
                      "description": "Concurrent query calls",
                      "defaultValue": "2"
                    },
                    "SUMMARY_CONTEXT_SIZE": {
                      "isOptional": false,
                      "description": "Context for description summaries",
                      "defaultValue": "8000"
                    },
                    "KEYWORD_MAX_ASYNC_LLM": {
                      "isOptional": false,
                      "description": "Concurrent keyword-extraction calls",
                      "defaultValue": "2"
                    },
                    "OLLAMA_LLM_NUM_THREAD": {
                      "isOptional": false,
                      "description": "CPU threads for generation",
                      "defaultValue": "8"
                    },
                    "EMBEDDING_BINDING_HOST": {
                      "isOptional": false,
                      "description": "Private embedding server URL",
                      "defaultValue": "http://${{ollama.RAILWAY_PRIVATE_DOMAIN}}:11434"
                    },
                    "LIGHTRAG_GRAPH_STORAGE": {
                      "isOptional": false,
                      "description": "Graph backend, plain tables",
                      "defaultValue": "PGTableGraphStorage"
                    },
                    "LIGHTRAG_VECTOR_STORAGE": {
                      "isOptional": false,
                      "description": "Vector store backend",
                      "defaultValue": "PGVectorStorage"
                    },
                    "EMBEDDING_FUNC_MAX_ASYNC": {
                      "isOptional": false,
                      "description": "Concurrent embedding calls",
                      "defaultValue": "2"
                    },
                    "MAX_EXTRACT_INPUT_TOKENS": {
                      "isOptional": false,
                      "description": "Largest extraction input",
                      "defaultValue": "8192"
                    },
                    "OLLAMA_EMBEDDING_NUM_CTX": {
                      "isOptional": false,
                      "description": "Embedding context window",
                      "defaultValue": "8192"
                    },
                    "POSTGRES_MAX_CONNECTIONS": {
                      "isOptional": false,
                      "description": "Connection pool ceiling",
                      "defaultValue": "12"
                    },
                    "ENTITY_EXTRACTION_USE_JSON": {
                      "isOptional": false,
                      "description": "Structured extraction output",
                      "defaultValue": "true"
                    },
                    "POSTGRES_VECTOR_INDEX_TYPE": {
                      "isOptional": false,
                      "description": "pgvector index type",
                      "defaultValue": "HNSW"
                    },
                    "LIGHTRAG_DOC_STATUS_STORAGE": {
                      "isOptional": false,
                      "description": "Document status backend",
                      "defaultValue": "PGDocStatusStorage"
                    },
                    "OLLAMA_EMBEDDING_NUM_THREAD": {
                      "isOptional": false,
                      "description": "CPU threads for embedding",
                      "defaultValue": "8"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:9621": {
                        "port": 9621
                      }
                    }
                  },
                  "volumeMounts": {
                    "109ec50c-e838-4ee4-a726-8cd54fec166a": {
                      "mountPath": "/app/storage"
                    }
                  }
                },
                "a42a2a73-868e-48b9-9010-8c8f07e9c294": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/ollama-dark.svg",
                  "name": "ollama",
                  "deploy": {
                    "startCommand": "/bin/sh -c '( until /bin/ollama list >/dev/null 2>&1; do sleep 2; done; for m in $OLLAMA_PULL_MODELS; do echo \"[railway] pulling $m\"; if /bin/ollama pull \"$m\" >/dev/null 2>&1; then echo \"[railway] ready: $m\"; else echo \"[railway] pull FAILED: $m\"; fi; done; echo \"[railway] models on volume:\"; /bin/ollama list ) & exec /bin/ollama serve'",
                    "healthcheckPath": "/",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ollama/ollama:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP server listening port",
                      "defaultValue": "11434"
                    },
                    "OLLAMA_HOST": {
                      "isOptional": false,
                      "description": "Dual-stack bind for private networking",
                      "defaultValue": "[::]:11434"
                    },
                    "OLLAMA_MODELS": {
                      "isOptional": false,
                      "description": "Model directory on the volume",
                      "defaultValue": "/root/.ollama/models"
                    },
                    "OLLAMA_NO_CLOUD": {
                      "isOptional": false,
                      "description": "Disable remote cloud inference",
                      "defaultValue": "1"
                    },
                    "OLLAMA_KEEP_ALIVE": {
                      "isOptional": false,
                      "description": "How long a model stays loaded",
                      "defaultValue": "30m"
                    },
                    "OLLAMA_PULL_MODELS": {
                      "isOptional": false,
                      "description": "Models pulled on first boot",
                      "defaultValue": "qwen2.5:3b bge-m3"
                    },
                    "OLLAMA_LOAD_TIMEOUT": {
                      "isOptional": false,
                      "description": "Model load timeout",
                      "defaultValue": "10m"
                    },
                    "OLLAMA_NUM_PARALLEL": {
                      "isOptional": false,
                      "description": "Concurrent requests per model",
                      "defaultValue": "1"
                    },
                    "OLLAMA_CONTEXT_LENGTH": {
                      "isOptional": false,
                      "description": "Default context window",
                      "defaultValue": "16384"
                    },
                    "OLLAMA_MAX_LOADED_MODELS": {
                      "isOptional": false,
                      "description": "Keep chat and embedding models resident",
                      "defaultValue": "2"
                    }
                  },
                  "volumeMounts": {
                    "a42a2a73-868e-48b9-9010-8c8f07e9c294": {
                      "mountPath": "/root/.ollama"
                    }
                  }
                },
                "ca2ff4d4-d96d-477a-b995-9005edd5b10f": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Cluster location on the volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{ POSTGRES_USER }}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL certificate expiry in days",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, read by the image",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "ca2ff4d4-d96d-477a-b995-9005edd5b10f": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "lightrag",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-19T15:19:30.856Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_ea4e2790124c4cda92b6",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "SUCCESS,SUCCESS,FAILED"
      }
    ]
  }
}
