Giter VIP home page Giter VIP logo

langserve-template's Introduction

LangServe Template

LangServe is a framework for deploying a chain or an agent easily. It is built with modularity in mind. This modularity enables LLM developers to develop a chain and an agent as a separate package called LangChain Template.

How this is created?

The project is created with langchain-cli

langchain app new .

The command will generate these files. To install a virtual environment, you run

poetry install

To run the server

langchain serve

How to develop

This repository is set as a template. You can always create a new repository based on this one easily. Or if you want to fork, feel free to do so.

After you spawn the Dev Container regardless of using Codespaces or Local Dev Container, it will install the extension and perform the poetry install right away. The result of poetry install will create the .venv folder with nesseary Python package to run the project. You can try to run

langchain serve

to see if it works.

Codespaces

The template is created with GitHub Codespaces. We recommend you use Codespaces to develop.

Local Development

We tested the .devcontainer on Macbook Pro M3 pro with Docker Desktop version 4.27.2. It seems to work just like Codespaces.

We have not yet tested this on Windows and Linux/Ubuntu but they should just work fine too.

How to deploy

To deploy, we create a docker-compose.yml that will build the Dockerfile. What you will need to provide is the .env file.

LANGCHAIN_TRACING_V2="false"
LANGCHAIN_API_KEY="<YOUR-API-KEY>"  # Update to your API key
LANGCHAIN_PROJECT="default"
LANGCHAIN_ENDPOINT="https://api.smith.langchain.com"

If you need more environment variables, you can add the .env file or create another one and append the list to env_files in docker-compose.yml

To build and run Docker.

docker compose up -d --build

This will spawn a Docker container that only runs the project (similar to the Production). If this works fine, you should be safe to deploy.

langserve-template's People

Contributors

akraradets avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.