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

[minor][doc] Updates setup instruction for LangServe app #549

Merged
merged 2 commits into from Mar 28, 2024

Conversation

rahilvora
Copy link
Contributor

Add Setup instruction to run langserve app locally.

Copy link

cla-bot bot commented Mar 20, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the username @rahilvora on file. In order for us to review and merge your code, please complete the Individual Contributor License Agreement here https://forms.gle/AQFbtkWRoHXUgipM6 .

This process is done manually on our side, so after signing the form one of the maintainers will add you to the contributors list.

For more details about why we have a CLA and other contribution guidelines please see: https://github.com/langchain-ai/langserve/blob/main/CONTRIBUTING.md.

@eyurtsev
Copy link
Collaborator

Thank you! Will review in a bit

@cla-bot cla-bot bot added the cla-signed label Mar 26, 2024
README.md Outdated
```

### 2. Activate `poetry` shell. Every command after step 2 should be executed within `poetry` shell.
```sh
poetry shell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not recommend poetry shell here. Instead have folks run

poetry run [command] (e.g,. poetry run pytest)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

README.md Outdated
poetry install
```

### 4. Install `langchain-openai` dependency to use ChatOpenAI llm. Do similar for other dependencies you plan to use.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first thing to do is to define the runnable in add_routes

so they need to go to server.py and edit add_routes(app. NotImplemented)


After that we can specify that they should add any 3rd party packages and set up env variables appropriately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

README.md Outdated

### 4. Install `langchain-openai` dependency to use ChatOpenAI llm. Do similar for other dependencies you plan to use.
```sh
pip intall langchain-openai
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be poetry add langchain-openai, but we also need to be a bit more vendor agnostic (even though openai is super popular!)

Could we re-write to say something along the lines of:

Set up any relevant 3rd party packages (e.g., langchain-openai, langchain-anthropic, langchain-mistral etc), and set up relevant env variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@eyurtsev
Copy link
Collaborator

@rahilvora sorry for taking so long -- had a large review queue in primary langchain repo right now

README.md Outdated
### 3. Use `poetry` to add 3rd party packages (e.g., langchain-openai, langchain-anthropic, langchain-mistral etc) and to run any commands like tests. More details on `poetry` commands is [here](https://python-poetry.org/docs/cli/).
```sh
poetry add [package-name] // e.g `poetry add langchain-openai`
poetry run [command] // e.g `poetry run pytest`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not an installation step

Suggested change
poetry run [command] // e.g `poetry run pytest`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the instruction for step 3 is to add 3rd party packages and run any commands

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

README.md Outdated

### 5. Serve your app
```sh
langchain serve --port=8100
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do poetry run langchain serve --port=8100?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@rahilvora rahilvora requested a review from eyurtsev March 27, 2024 16:46
@eyurtsev eyurtsev merged commit 5a629af into langchain-ai:main Mar 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants