llm applications
1.0.0
构建基于抹布的LLM生产应用程序的综合指南。
在本指南中,我们将学习如何:
我们将使用OpenAI访问诸如gpt-3.5-turbo , gpt-4等的CHATGPT型号,以及任何Scale Endpoints,访问Llama-2-70b等OSS LLM。确保为两者创建您的帐户并准备好您的凭据。
g3.8xlarge头节点进行分期启动新的AnyScale工作区,该节点具有2个GPU和32个CPU。我们还可以添加GPU工人节点以更快地运行工作负载。如果您不在任何规模上,则可以在云上配置类似实例。default_cluster_env_2.6.2_py39群集环境。us-west-2 。git clone https://github.com/ray-project/llm-applications.git .
git config --global user.name < GITHUB-USERNAME >
git config --global user.email < EMAIL-ADDRESS >我们的数据已经准备就绪,请访问/efs/shared_storage/goku/docs.ray.io/en/master/ (在登台上, us-east-1 ),但是如果您想自己加载它,请运行此bash命令(更改/desired/output/directory ,但是请确保它在共享存储上,以便它可以访问工人的工人)
git clone https://github.com/ray-project/llm-applications.git .然后通过指定.env文件中的值并安装依赖项来正确设置环境:
pip install --user -r requirements.txt
export PYTHONPATH= $PYTHONPATH : $PWD
pre-commit install
pre-commit autoupdatetouch .env
# Add environment variables to .env
OPENAI_API_BASE= " https://api.openai.com/v1 "
OPENAI_API_KEY= " " # https://platform.openai.com/account/api-keys
ANYSCALE_API_BASE= " https://api.endpoints.anyscale.com/v1 "
ANYSCALE_API_KEY= " " # https://app.endpoints.anyscale.com/credentials
DB_CONNECTION_STRING= " dbname=postgres user=postgres host=localhost password=postgres "
source .env现在,我们已经准备好通过rag.ipynb互动笔记本来开发和服务我们的LLM应用程序!
Llama-3-70b开始使用EnyScale Endpoint($ 1/m令牌)和可应要求提供的私人端点(1M免费令牌试用),开始使用(+微调)oss llms。