LangChain Support
Back to Self Hosted

How to setup path-based routing for self-hosted LangSmith

Self Hosted·1 min read·Nov 17, 2025··

Setup Path-Based Routing

When deploying LangSmith with path-based routing (using a basePath), you need to configure additional environment variables to ensure URLs are generated correctly throughout the application.

  1. Configure your basic path settings in your Helm chart values file:

    config:
      basePath: "langsmith/dev"
      subdomain: "langsmith/dev"
  2. Add the required environment variables to fix backend URL generation:

    commonEnv:
      - name: LANGCHAIN_ENDPOINT
        value: "/langsmith/dev/api"
      - name: LANGCHAIN_PLATFORM_ENDPOINT
        value: "/langsmith/dev/api"
  3. Set your hostname as usual:

    hostname: "your-domain.com"
  4. Deploy your updated Helm chart configuration

  5. Verify that attachment downloads and other operations now include the correct basePath in their URLs

Usage

After implementing this configuration, your LangSmith deployment will properly handle path-based routing. All API endpoints and file operations (including attachment downloads) will correctly include the basePath prefix in their URLs.

For example, instead of generating URLs like https://your-domain.com/api/public/download, the system will correctly generate https://your-domain.com/langsmith/dev/api/public/download.

Note: You may see a minor 404 error for favicon.ico on first audio playback, but this doesn't affect core functionality and occurs only on the initial attempt.