{
  "manifest_version": "1.0.0",
  "template": {
    "id": "1267e7d7-9fe5-4fbb-9182-61fbaa164839",
    "slug": "pdfmathtranslate",
    "name": "PDFMathTranslate",
    "description": "Translate academic PDFs keeping layout, formulas and charts intact",
    "url": "https://railway.com/deploy/pdfmathtranslate",
    "upstream": {
      "repo_url": "https://github.com/INAPP-Mobile/pdfmathtranslate"
    }
  },
  "services": [
    {
      "name": "ollama/ollama:latest",
      "source": {
        "image": "ollama/ollama:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/root/.ollama",
      "http": false
    },
    {
      "name": "pdfmathtranslate",
      "source": {
        "repo": "https://github.com/INAPP-Mobile/pdfmathtranslate"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "OLLAMA_BASE_URL",
      "service": "ollama/ollama:latest",
      "description": "Ollama API base URL. Auto-configured to the internal Railway private domain over HTTPS. Exposed to the app as PDF2ZH_OLLAMA_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PORT",
      "service": "pdfmathtranslate",
      "description": "Public HTTP port. Railway routes the public domain to this port. Keep it equal to PDF2ZH_SERVER_PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "PDF2ZH_OLLAMA",
      "service": "pdfmathtranslate",
      "description": "Use the bundled Ollama sibling service as the translation engine. Set to false to pick another provider in the Web UI.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "PDF2ZH_OLLAMA_HOST",
      "service": "pdfmathtranslate",
      "description": "Ollama API base URL. Auto-linked to the sibling Ollama service's private domain over :11434.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PDF2ZH_SERVER_PORT",
      "service": "pdfmathtranslate",
      "description": "Port the Web UI binds inside the container. Must match PORT (the public domain target). Defaults to 8080.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "pdfmathtranslate"
      }
    },
    "cli": "railway deploy --template pdfmathtranslate",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "1267e7d7-9fe5-4fbb-9182-61fbaa164839",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "14d33fb2-a04d-4751-9459-4b5db379b038": {
                  "name": "ollama/ollama:latest",
                  "source": {
                    "image": "ollama/ollama:latest"
                  },
                  "variables": {
                    "OLLAMA_BASE_URL": {
                      "description": "Ollama API base URL. Auto-configured to the internal Railway private domain over HTTPS. Exposed to the app as PDF2ZH_OLLAMA_HOST.",
                      "defaultValue": "https://${{RAILWAY_PRIVATE_DOMAIN}}:11434"
                    }
                  },
                  "volumeMounts": {
                    "14d33fb2-a04d-4751-9459-4b5db379b038": {
                      "mountPath": "/root/.ollama"
                    }
                  }
                },
                "732f30fc-c3f7-435d-92da-43835b2372c5": {
                  "icon": null,
                  "name": "pdfmathtranslate",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/INAPP-Mobile/pdfmathtranslate",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "description": "Public HTTP port. Railway routes the public domain to this port. Keep it equal to PDF2ZH_SERVER_PORT.",
                      "defaultValue": "8080"
                    },
                    "PDF2ZH_OLLAMA": {
                      "isOptional": false,
                      "description": "Use the bundled Ollama sibling service as the translation engine. Set to false to pick another provider in the Web UI.",
                      "defaultValue": "false"
                    },
                    "PDF2ZH_OLLAMA_HOST": {
                      "isOptional": false,
                      "description": "Ollama API base URL. Auto-linked to the sibling Ollama service's private domain over :11434.",
                      "defaultValue": "${{ollama/ollama:latest.OLLAMA_BASE_URL}}"
                    },
                    "PDF2ZH_SERVER_PORT": {
                      "isOptional": false,
                      "description": "Port the Web UI binds inside the container. Must match PORT (the public domain target). Defaults to 8080.",
                      "defaultValue": "8080"
                    },
                    "PDF2ZH_OLLAMA_MODEL": {
                      "isOptional": true,
                      "description": "Ollama model to translate with (e.g. qwen3:8b, gemma2, llama3.2). No model is pre-pulled — pull one first (ollama pull <model>), then set it here or in the Web UI Settings.",
                      "defaultValue": ""
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-04T17:54:19.363Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-04T13:47:57.894Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_924a48295f1845df8fd1",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 123,
    "typical_build_seconds": 51,
    "typical_start_seconds": 20,
    "slowest_service": "pdfmathtranslate"
  }
}
