Skip to main content

Using your self-hosted instance of LangSmith

This guide will walk you through the process of using your self-hosted instance of LangSmith.

Self-Hosted LangSmith Instance Required

This guide assumes you have already deployed a self-hosted LangSmith instance. If you have not, please refer to the kubernetes deployment guide or the docker deployment guide.

Configuring the application you want to use with LangSmith

  1. Once you have deployed your instance, you can access the LangSmith UI at http://<host>.
  2. The backend API will be available at http://<host>/api and the hub API will be available at http://<host>/api-hub.

To use the LangSmith API, you will need to set the following environment variables in your application:

LANGCHAIN_ENDPOINT=http://<host>/api
LANGCHAIN_HUB_API_URL=http://<host>/api-hub
LANGCHAIN_API_KEY=foo # Set to a legitimate API key if using OAuth

You can also configure these variables directly in the LangSmith SDK client:

import langsmith

langsmith_client = langsmith.Client(
api_key='<api_key>',
api_url='http://<host>/api',
)

import langchainhub

langchainhub.Client(
api_key='<api_key>',
api_url='http://<host>/api-hub'
)

After setting the above, you should be able to run your code and see the results in your self-hosted instance. We recommend running through the quickstart guide to get a feel for how to use LangSmith.


Was this page helpful?


You can leave detailed feedback on GitHub.