Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harrison/docs smith serve #12898

Merged
merged 6 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/.local_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ poetry run python scripts/model_feat_table.py
poetry run nbdoc_build --srcdir docs
cp ../cookbook/README.md src/pages/cookbook.mdx
cp ../.github/CONTRIBUTING.md docs/contributing.md
wget https://raw.githubusercontent.com/langchain-ai/langserve/main/README.md -O docs/guides/deployments/langserve.md
wget https://raw.githubusercontent.com/langchain-ai/langserve/main/README.md -O docs/langserve.md
poetry run python scripts/generate_api_reference_links.py
yarn install
yarn start
39 changes: 27 additions & 12 deletions docs/docs/get_started/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,41 @@ sidebar_position: 0
- **Are context-aware**: connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.)
- **Reason**: rely on a language model to reason (about how to answer based on provided context, what actions to take, etc.)

The main value props of LangChain are:
1. **Components**: abstractions for working with language models, along with a collection of implementations for each abstraction. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not
2. **Off-the-shelf chains**: a structured assembly of components for accomplishing specific higher-level tasks
This framework consists of several parts.
You can see how the parts interact with each other below:

![LangChain Diagram](/img/langchain_stack.jpg)

These parts include:

- **[LangChain Packages]**: The Python and JavaScript packages. Contains interfaces and integrations for a myriad of components, a basic run time for combining these components into chains and agents, and off-the-shelf implementations of chains and agents.
- **[LangChain Templates](https://github.com/langchain-ai/langchain/tree/master/templates)**: A collection of easily deployable reference architectures for a wide variety of tasks.
- **[LangServe](https://github.com/langchain-ai/langserve)**: A library for deploying LangChain chains as a REST API.
- **[LangSmith](https://smith.langchain.com/)**: A developer platform that lets you debug, test, evaluate, and monitor chains built on any LLM framework and seamlessly integrates with LangChain.

Together, these products simplify the entire application lifecycle:
- **Develop**: Write your applications in LangChain/LangChain.js. Hit the ground running using Templates for reference.
- **Productionize**: Use LangSmith to inspect, test and monitor your chains, so that you can constantly improve and deploy with confidence.
- **Deploy**: Turn any chain into an API with LangServe.

## LangChain Packages

The main value props of the LangChain packages are:
1. **Components**: composable tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not
2. **Off-the-shelf chains**: built-in assemblages of components for accomplishing higher-level tasks

Off-the-shelf chains make it easy to get started. Components make it easy to customize existing chains and build new ones.

Off-the-shelf chains make it easy to get started. For complex applications, components make it easy to customize existing chains and build new ones.

## Get started

[Here’s](/docs/get_started/installation) how to install LangChain, set up your environment, and start building.

We recommend following our [Quickstart](/docs/get_started/quickstart) guide to familiarize yourself with the framework by building your first LangChain application.

_**Note**: These docs are for the LangChain [Python package](https://github.com/langchain-ai/langchain). For documentation on [LangChain.js](https://github.com/langchain-ai/langchainjs), the JS/TS version, [head here](https://js.langchain.com/docs)._

## Modules

LangChain provides standard, extendable interfaces and external integrations for the following modules, listed from least to most complex:
LangChain provides standard, extendable interfaces and integrations for the following modules, listed from least to most complex:

#### [Model I/O](/docs/modules/model_io/)
Interface with language models
Expand All @@ -41,21 +59,18 @@ Log and stream intermediate steps of any chain

## Examples, ecosystem, and resources
### [Use cases](/docs/use_cases/question_answering/)
Walkthroughs and best-practices for common end-to-end use cases, like:
Walkthroughs and techniques for common end-to-end use cases, like:
- [Document question answering](/docs/use_cases/question_answering/)
- [Chatbots](/docs/use_cases/chatbots/)
- [Analyzing structured data](/docs/use_cases/qa_structured/sql/)
- and much more...

### [Guides](/docs/guides/)
Learn best practices for developing with LangChain.
Best practices for developing with LangChain.

### [Ecosystem](/docs/integrations/providers/)
LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. Check out our growing list of [integrations](/docs/integrations/providers/) and [dependent repos](/docs/additional_resources/dependents).

### [Additional resources](/docs/additional_resources/)
Our community is full of prolific developers, creative builders, and fantastic teachers. Check out [YouTube tutorials](/docs/additional_resources/youtube) for great tutorials from folks in the community, and [Gallery](https://github.com/kyrolabs/awesome-langchain) for a list of awesome LangChain projects, compiled by the folks at [KyroLabs](https://kyrolabs.com).

### [Community](/docs/community)
Head to the [Community navigator](/docs/community) to find places to ask questions, share feedback, meet other developers, and dream about the future of LLM’s.

Expand Down
13 changes: 13 additions & 0 deletions docs/docs/get_started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ from langchain.llms import OpenAI
llm = OpenAI(openai_api_key="...")
```

## LangSmith Setup

Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls.
As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your chain or agent.
The best way to do this is with [LangSmith](smith.langchain.com).

Note that LangSmith is not needed, but it is helpful.
If you do want to use LangSmith, after you sign up at the link above, make sure to set your environment variables to start logging traces:

```shell
export LANGCHAIN_TRACING_V2="true"
export LANGCHAIN_API_KEY=...
```

## Building an application

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# LangSmith
---
sidebar_class_name: hidden
---

import DocCardList from "@theme/DocCardList";
# LangSmith

[LangSmith](https://smith.langchain.com) helps you trace and evaluate your language model applications and intelligent agents to help you
move from prototype to production.

Check out the [interactive walkthrough](/docs/guides/langsmith/walkthrough) below to get started.
Check out the [interactive walkthrough](/docs/guides/langsmith/walkthrough) to get started.

For more information, please refer to the [LangSmith documentation](https://docs.smith.langchain.com/).

Expand All @@ -18,5 +20,3 @@ check out the [LangSmith Cookbook](https://github.com/langchain-ai/langsmith-coo
- How to fine-tune a LLM on real usage data ([link](https://github.com/langchain-ai/langsmith-cookbook/blob/main/fine-tuning-examples/export-to-openai/fine-tuning-on-chat-runs.ipynb)).
- How to use the [LangChain Hub](https://smith.langchain.com/hub) to version your prompts ([link](https://github.com/langchain-ai/langsmith-cookbook/blob/main/hub-examples/retrieval-qa-chain/retrieval-qa.ipynb))


<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"tags": []
},
"source": [
"# LangSmith Walkthrough\n",
"# Walkthrough\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/langsmith/walkthrough.ipynb)\n",
"\n",
"LangChain makes it easy to prototype LLM applications and Agents. However, delivering LLM applications to production can be deceptively difficult. You will likely have to heavily customize and iterate on your prompts, chains, and other components to create a high-quality product.\n",
Expand Down Expand Up @@ -790,7 +790,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
"version": "3.9.1"
}
},
"nbformat": 4,
Expand Down
27 changes: 17 additions & 10 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ const config = {
sidebarId: "integrations",
label: "Integrations",
},
{
type: "docSidebar",
position: "left",
sidebarId: "guides",
label: "Guides",
},
{
href: "https://api.python.langchain.com",
label: "API",
Expand Down Expand Up @@ -192,30 +198,31 @@ const config = {
{ label: "Gallery", href: "https://github.com/kyrolabs/awesome-langchain" }
]
},
{
href: "https://chat.langchain.com",
label: "Chat our docs",
position: "right",
},
{
type: "dropdown",
label: "Also by LangChain",
position: "right",
items: [
{
href: "https://chat.langchain.com",
label: "Chat our docs",
},
{
href: "https://smith.langchain.com",
label: "LangSmith",
},
{
href: "https://smith.langchain.com/hub",
label: "LangChain Hub",
href: "https://github.com/langchain-ai/langserve",
label: "LangServe GitHub",
},
{
href: "https://github.com/langchain-ai/langserve",
label: "LangServe",
href: "https://smith.langchain.com/hub",
label: "LangChain Hub",
},
{
href: "https://js.langchain.com/docs",
label: "JS/TS",
href: "https://js.langchain.com",
label: "JS/TS Docs",
},
]
},
Expand Down
24 changes: 11 additions & 13 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
label: "Get started",
collapsed: false,
collapsible: false,
items: [{ type: "autogenerated", dirName: "get_started" }],
items: [{ type: "autogenerated", dirName: "get_started" }, "security"],
link: {
type: 'generated-index',
description: 'Get started with LangChain',
Expand All @@ -46,29 +46,24 @@ module.exports = {
{
type: "category",
label: "Modules",
collapsed: false,
collapsed: true,
items: [{ type: "autogenerated", dirName: "modules" } ],
link: {
type: 'doc',
id: "modules/index"
},
},
{
type: "doc",
label: "Security",
id: "security",
},
{type: "doc", id: "langserve", label: "LangServe"},
{
type: "category",
label: "Guides",
label: "LangSmith",
collapsed: true,
items: [{ type: "autogenerated", dirName: "guides" }],
items: [{ type: "autogenerated", dirName: "langsmith" } ],
link: {
type: 'generated-index',
description: 'Design guides for key parts of the development process',
slug: "guides",
type: 'doc',
id: "langsmith/index"
},
}
},
],
integrations: [
{
Expand Down Expand Up @@ -111,4 +106,7 @@ module.exports = {
use_cases: [
{type: "autogenerated", dirName: "use_cases" }
],
guides: [
{type: "autogenerated", dirName: "guides" }
],
};
Binary file added docs/static/img/langchain_stack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/vercel_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ python3.11 scripts/model_feat_table.py
nbdoc_build --srcdir docs
cp ../cookbook/README.md src/pages/cookbook.mdx
cp ../.github/CONTRIBUTING.md docs/contributing.md
wget https://raw.githubusercontent.com/langchain-ai/langserve/main/README.md -O docs/guides/deployments/langserve.md
wget https://raw.githubusercontent.com/langchain-ai/langserve/main/README.md -O docs/langserve.md
python3.11 scripts/generate_api_reference_links.py