Giter Club home page Giter Club logo

langserve-template's Introduction

LangServe + Heroku

Poetry

poetry 설치

pip install poetry

필요한 패키지 추가

poetry add langchain-openai

langserve 실행

poetry run langchain serve

langchain-template 코드 추가

poetry run langchain app add retrieval-agent

langchain-template 코드 제거

poetry run langchain app remove retrieval-agent

Procfile

app 패키지(폴더) 하위의 server.py 안에 app 으로 진입점 초기화 한다는 뜻

Untitled

web: uvicorn app.server:app --host=0.0.0.0 --port=${PORT:-5000}

프로젝트 설정

  1. requirements.txt 생성

    • poetry 사용시
    poetry export -f requirements.txt --output requirements.txt --without-hashes
  2. Procfile 생성

    • Procfile 생성 후 아래 내용을 기입
    web: uvicorn app.server:app --host=0.0.0.0 --port=${PORT:-5000}
  3. git init

    • github 에 소스코드 업로드

Heroku

Install the Heroku CLI

Download and install the Heroku CLI.

heroku 대시보드에 접속하여 새로운 앱을 생성

앱이름: langserve-template 으로 이미 생성해 놓았음

Untitled

터미널에 heroku init

아래의 langserve-template 대신 본인의 앱이름을 입력 가능!

heorku git:remote -a langserve-template

배포

git push heroku main

환경변수

heroku config:set OPENAI_API_KEY=이곳에_API_KEY_입력
heroku config:set LANGCHAIN_TRACING_V2=true
heroku config:set LANGCHAIN_ENDPOINT=https://api.smith.langchain.com
heroku config:set LANGCHAIN_PROJECT=LANGSERVE
heroku config:set LANGCHAIN_API_KEY=이곳에_API_KEY_입력

langserve-template's People

Contributors

teddylee777 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.