It is broken into two parts: installation and setup, and then references to specific Beam wrappers.Installation and Setup‚ÄãCreate an accountInstall the Beam CLI with curl https://raw.githubusercontent.com/slai-labs/get-beam/main/get-beam.sh -sSfL | shRegister API keys with beam configureSet environment variables (BEAM_CLIENT_ID) and (BEAM_CLIENT_SECRET)Install the Beam SDK pip install beam-sdkWrappers‚ÄãLLM‚ÄãThere exists a Beam LLM wrapper, which you can access withfrom langchain.llms.beam import BeamDefine your Beam app.‚ÄãThis is the environment you‚Äôll be developing against once you start the app.
It's also used to define the maximum response length from the model.llm = Beam(model_name="gpt2",           name="langchain-gpt2-test",           cpu=8,           memory="32Gi",           gpu="A10G",           python_version="python3.8",           python_packages=[               "diffusers[torch]>=0.10",               "transformers",               "torch",               "pillow",               "accelerate",               "safetensors",               "xformers",],           max_length="50",           verbose=False)Deploy your Beam app‚ÄãOnce defined, you can deploy your Beam app by calling your model's _deploy() method.llm._deploy()Call your Beam app‚ÄãOnce a beam model is deployed, it can be called by callying your model's _call() method.
This page covers how to use Beam within LangChain.
This page covers how to use Beam within LangChain. ->: It is broken into two parts: installation and setup, and then references to specific Beam wrappers.Installation and Setup‚ÄãCreate an accountInstall the Beam CLI with curl https://raw.githubusercontent.com/slai-labs/get-beam/main/get-beam.sh -sSfL | shRegister API keys with beam configureSet environment variables (BEAM_CLIENT_ID) and (BEAM_CLIENT_SECRET)Install the Beam SDK pip install beam-sdkWrappers‚ÄãLLM‚ÄãThere exists a Beam LLM wrapper, which you can access withfrom langchain.llms.beam import BeamDefine your Beam app.‚ÄãThis is the environment you‚Äôll be developing against once you start the app.
It's also used to define the maximum response length from the model.llm = Beam(model_name="gpt2",           name="langchain-gpt2-test",           cpu=8,           memory="32Gi",           gpu="A10G",           python_version="python3.8",           python_packages=[               "diffusers[torch]>=0.10",               "transformers",               "torch",               "pillow",               "accelerate",               "safetensors",               "xformers",],           max_length="50",           verbose=False)Deploy your Beam app‚ÄãOnce defined, you can deploy your Beam app by calling your model's _deploy() method.llm._deploy()Call your Beam app‚ÄãOnce a beam model is deployed, it can be called by callying your model's _call() method.