Using your self-hosted instance of LangSmith
This guide will walk you through the process of using your self-hosted instance of LangSmith.
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
There are two main interfaces you can use to interact with LangSmith, the LangSmith UI and the LangSmith API.
- Once you have deployed your instance, you can access the LangSmith UI at
http://<host>
. - The LangSmith API will be available at
http://<host>/api/v1
To use the API of your instance, you will need to set the following environment variables in your application:
LANGSMITH_ENDPOINT=http://<host>/api
LANGSMITH_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/v1',
)
# Deprecated, you can use the Langsmith client for all interactions
import langchainhub
# Deprecated, use langsmith.Client instead
langchainhub.Client(
api_key='<api_key>',
api_url='http://<host>/api/v1'
)
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.
API Reference
To access the API reference, navigate to http://<host>/api/docs
in your browser.