Skip to content

Commit

Permalink
chore: cleanup api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain-infra committed Jan 10, 2025
1 parent 6b5b2a9 commit 234145b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions docs/self_hosting/egress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ sidebar_label: Egress for Subscription Metrics and Operational Metadata
sidebar_position: 7
---

:::important Version Requirement
This section only applies to customers who are not running in offline mode and assumes you are using a self-hosted LangSmith instance serving version 0.9.0 or later.
Previous versions of LangSmith did not have this feature.
:::

# Egress for Subscription Metrics and Operational Metadata

Self-Hosted LangSmith instances store all information locally and will never send sensitive information outside of your network. We currently only track platform usage for billing purposes according to the entitlements in your order. In order to better remotely support our customers, we do require egress to `https://beacon.langchain.com`.
Expand Down
15 changes: 7 additions & 8 deletions docs/self_hosting/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ This guide assumes you have already deployed a self-hosted LangSmith instance. I

### Configuring the application you want to use with LangSmith

LangSmith has two APIs: One for interacting with the LangChain Hub/prompts and one for interacting with the backend of the LangSmith application. Each exists at its own URL and in a self-hosted environment are set via the `LANGCHAIN_HUB_API_URL` and `LANGCHAIN_ENDPOINT` environment variables, respectively, and have their own separate SDKs.
There are two main interfaces you can use to interact with LangSmith, the LangSmith UI and the LangSmith API.

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`
2. The LangSmith API will be available at `http://<host>/api/v1`

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

```bash
LANGCHAIN_ENDPOINT=http://<host>/api
LANGCHAIN_HUB_API_URL=http://<host>/api # Only set this if using the legacy langchainhub SDK
LANGCHAIN_API_KEY=foo # Set to a legitimate API key if using OAuth
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:
Expand All @@ -34,7 +33,7 @@ import langsmith

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

# Deprecated, you can use the Langsmith client for all interactions
Expand All @@ -43,7 +42,7 @@ import langchainhub
# Deprecated, use langsmith.Client instead
langchainhub.Client(
api_key='<api_key>',
api_url='http://<host>/api'
api_url='http://<host>/api/v1'
)
```

Expand Down

0 comments on commit 234145b

Please sign in to comment.