{"record":{"id":"8854ab4254547480","repo":"langchain-ai/langchain","slug":"loading-from-the-deprecated-github-based-hub-is-no","errorCode":null,"errorMessage":"Loading from the deprecated github-based Hub is no longer supported. Please use the new LangChain Hub at https://smith.langchain.com/hub instead.","messagePattern":"Loading from the deprecated github-based Hub is no longer supported\\. Please use the new LangChain Hub at https://smith\\.langchain\\.com/hub instead\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/core/langchain_core/prompts/loading.py","lineNumber":246,"sourceCode":"        allow_dangerous_paths: If `False` (default), file paths referenced\n            inside the loaded config (such as `template_path`, `examples`,\n            and `example_prompt_path`) are validated to reject absolute paths\n            and directory traversal (`..`) sequences. Set to `True` only\n            if you trust the source of the config.\n\n    Returns:\n        A `PromptTemplate` object.\n\n    Raises:\n        RuntimeError: If the path is a LangChainHub path.\n    \"\"\"\n    if isinstance(path, str) and path.startswith(\"lc://\"):\n        msg = (\n            \"Loading from the deprecated github-based Hub is no longer supported. \"\n            \"Please use the new LangChain Hub at https://smith.langchain.com/hub \"\n            \"instead.\"\n        )\n        raise RuntimeError(msg)\n    return _load_prompt_from_file(\n        path, encoding, allow_dangerous_paths=allow_dangerous_paths\n    )\n\n\ndef _load_prompt_from_file(\n    file: str | Path,\n    encoding: str | None = None,\n    *,\n    allow_dangerous_paths: bool = False,\n) -> BasePromptTemplate[str]:\n    \"\"\"Load prompt from file.\"\"\"\n    # Convert file to a Path object.\n    file_path = Path(file)\n    # Load from either json or yaml.\n    if file_path.suffix == \".json\":\n        with file_path.open(encoding=encoding) as f:\n            config = json.load(f)","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/langchain-ai/langchain/blob/e32fa9a52eab3b61ad7a45399bfde59b3e580fc4/libs/core/langchain_core/prompts/loading.py#L228-L264","documentation":"`load_prompt` raises a `RuntimeError` (not `ValueError`) when given a path starting with `lc://` — the scheme of the old GitHub-based LangChain Hub. That hub is dead, so the scheme is unconditionally rejected with a pointer to the successor, the LangChain Hub at https://smith.langchain.com/hub.","triggerScenarios":"Calling `load_prompt('lc://prompts/some/prompt')` or loading a config that embeds an `lc://` reference.","commonSituations":"Old tutorials and notebooks from the 2023-era LangChain; legacy codebases that pinned prompts by `lc://` handle; copied snippets from outdated blog posts.","solutions":["Pull the prompt from the LangSmith Hub instead: `from langchain import hub; prompt = hub.pull('owner/prompt-name')` (requires `langchain` package + `LANGSMITH_API_KEY`).","Vendor the prompt: download its text once, save it locally as f-string JSON/YAML, and `load_prompt('file.json')`.","Replace the `lc://` handle with an inline template built via `PromptTemplate.from_template`."],"exampleFix":"# before\nfrom langchain_core.prompts import load_prompt\nprompt = load_prompt('lc://hello/name')  # RuntimeError\n\n# after\nfrom langchain import hub\nprompt = hub.pull('hello-name')","handlingStrategy":"try-catch","validationCode":"if isinstance(path, str) and path.startswith('lc://'):\n    raise ValueError('lc:// hub handles are dead; use langchain hub.pull instead')","typeGuard":"def is_hub_handle(path: str) -> bool:\n    return path.startswith('lc://')","tryCatchPattern":"from langchain_core.prompts import load_prompt\ntry:\n    prompt = load_prompt(path)\nexcept RuntimeError as e:\n    if 'github-based Hub' in str(e):\n        from langchain import hub\n        prompt = hub.pull(path.removeprefix('lc://'))  # best-effort migration\n    else:\n        raise","preventionTips":["Sweep legacy codebases for 'lc://' references when upgrading LangChain.","Vendor critical Hub prompts locally so loads do not depend on a hub service."],"tags":["prompts","hub","deprecation","migration","runtimeerror"],"backgroundTag":null,"analyzedSha":"e32fa9a52eab3b61ad7a45399bfde59b3e580fc4","analyzedAt":"2026-08-14T18:42:09.092Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}