{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0def174e-8e09-40fa-b0e2-581830e8ea0e",
    "slug": "llamacpp-1",
    "name": "LLaMA.cpp",
    "description": "llama.cpp — OpenAI-compatible LLM inference server, bring your own GGUF",
    "url": "https://railway.com/deploy/llamacpp-1",
    "upstream": {
      "repo_url": "https://github.com/INAPP-Mobile/railway-llama-cpp"
    }
  },
  "services": [
    {
      "name": "railway-llama-cpp",
      "source": {
        "repo": "https://github.com/INAPP-Mobile/railway-llama-cpp"
      },
      "needs_volume": true,
      "volume_mount_path": "/opt/models/.cache/huggingface",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "N_CTX",
      "service": "railway-llama-cpp",
      "description": "Context window size in tokens. Increase for longer conversations (e.g., 8192, 16384). Higher values use more memory.",
      "secret": false,
      "strategy": "default",
      "default": "4096"
    },
    {
      "key": "N_THREADS",
      "service": "railway-llama-cpp",
      "description": "Number of CPU threads to use for inference. Increase for multi-core CPUs. Set to 1 for single-threaded operation.",
      "secret": false,
      "strategy": "default",
      "default": "4"
    },
    {
      "key": "MODEL_PATH",
      "service": "railway-llama-cpp",
      "description": "Directory path where GGUF model files are mounted (Railway volume mount). Mount your models to this path via the volume settings.",
      "secret": false,
      "strategy": "default",
      "default": "/opt/models/.cache/huggingface"
    },
    {
      "key": "HF_HUB_CACHE",
      "service": "railway-llama-cpp",
      "description": "Huggingface CLI cache path",
      "secret": false,
      "strategy": "default",
      "default": "/opt/models/.cache/huggingface"
    },
    {
      "key": "HF_TOKEN_PATH",
      "service": "railway-llama-cpp",
      "description": "Huggingface CLI cache path",
      "secret": true,
      "strategy": "default",
      "default": "/opt/models/.cache/huggingface/token"
    },
    {
      "key": "HF_ASSETS_CACHE",
      "service": "railway-llama-cpp",
      "description": "Huggingface CLI cache path",
      "secret": false,
      "strategy": "default",
      "default": "/opt/models/.cache/huggingface/assets"
    },
    {
      "key": "HF_STORED_TOKENS_PATH",
      "service": "railway-llama-cpp",
      "description": "Huggingface CLI cache path",
      "secret": true,
      "strategy": "default",
      "default": "/opt/models/.cache/huggingface/stored_tokens"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "llamacpp-1"
      }
    },
    "cli": "railway deploy --template llamacpp-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0def174e-8e09-40fa-b0e2-581830e8ea0e",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "5270730e-1dff-4135-bf0e-d02a43559881": {
                  "icon": null,
                  "name": "railway-llama-cpp",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/INAPP-Mobile/railway-llama-cpp",
                    "rootDirectory": "/"
                  },
                  "variables": {
                    "N_CTX": {
                      "description": "Context window size in tokens. Increase for longer conversations (e.g., 8192, 16384). Higher values use more memory.",
                      "defaultValue": "4096"
                    },
                    "HF_TOKEN": {
                      "isOptional": true,
                      "description": "Hugging Face access token for downloading from private repos. Not needed for public models. Use Railway secret store for this value.",
                      "defaultValue": ""
                    },
                    "N_THREADS": {
                      "description": "Number of CPU threads to use for inference. Increase for multi-core CPUs. Set to 1 for single-threaded operation.",
                      "defaultValue": "4"
                    },
                    "MODEL_PATH": {
                      "description": "Directory path where GGUF model files are mounted (Railway volume mount). Mount your models to this path via the volume settings.",
                      "defaultValue": "/opt/models/.cache/huggingface"
                    },
                    "HF_HUB_CACHE": {
                      "description": "Huggingface CLI cache path",
                      "defaultValue": "/opt/models/.cache/huggingface"
                    },
                    "DEFAULT_MODEL": {
                      "isOptional": true,
                      "description": "Optional: Specific model filename to load by default (e.g., 'llama-2-7b.Q4_0.gguf'). Leave empty to auto-detect from mounted models.",
                      "defaultValue": ""
                    },
                    "HF_TOKEN_PATH": {
                      "description": "Huggingface CLI cache path",
                      "defaultValue": "/opt/models/.cache/huggingface/token"
                    },
                    "MODEL_REPO_ID": {
                      "isOptional": true,
                      "description": "Hugging Face repo with GGUF models to auto-download on startup (requires HF_TOKEN if private repo). Example: unsloth/Meta-Llama-3.1-8B-Instruct-GGUF",
                      "defaultValue": ""
                    },
                    "HF_ASSETS_CACHE": {
                      "description": "Huggingface CLI cache path",
                      "defaultValue": "/opt/models/.cache/huggingface/assets"
                    },
                    "HF_STORED_TOKENS_PATH": {
                      "description": "Huggingface CLI cache path",
                      "defaultValue": "/opt/models/.cache/huggingface/stored_tokens"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "5270730e-1dff-4135-bf0e-d02a43559881": {
                      "mountPath": "/opt/models/.cache/huggingface"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T07:09:06.267Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_18c4a2e28b9449978279",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 154,
    "typical_build_seconds": 102,
    "typical_start_seconds": 10,
    "slowest_service": "railway-llama-cpp"
  }
}
