PipelineAI allows you to run your ML models at scale in the cloud. It also provides API access to several LLM models.This notebook goes over how to use LangChain with PipelineAI.
PipelineAI example
This example shows how PipelineAI integrated with LangChain and it is created by PipelineAI.Setup
Thepipeline-ai library is required to use the PipelineAI API, AKA Pipeline Cloud. Install pipeline-ai using pip install pipeline-ai.
Example
Imports
Set the environment API Key
Make sure to get your API key from PipelineAI. Check out the cloud quickstart guide. You’ll be given a 30 day free trial with 10 hours of serverless GPU compute to test different models.Create the PipelineAI instance
When instantiating PipelineAI, you need to specify the id or tag of the pipeline you want to use, e.g.pipeline_key = "public/gpt-j:base". You then have the option of passing additional pipeline-specific keyword arguments:
Create a Prompt template
We will create a prompt template for Question and Answer.Initiate the LLMChain
Run the LLMChain
Provide a question and run the LLMChain.Connect these docs to Claude, VSCode, and more via MCP for real-time answers.