">[Prediction Guard](https://docs.predictionguard.com/) gives a quick and easy access to state-of-the-art open and closed access LLMs, without needing to spend days and weeks figuring out all of the implementation details, managing a bunch of different API specs, and setting up the infrastructure for model deployments."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "3RqWPav7AtKL"
},
"outputs": [],
"source": [
"! pip install predictionguard langchain"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "2xe8JEUwA7_y"
},
"outputs": [],
"source": [
"import os\n",
"\n",
"import predictionguard as pg\n",
"from langchain.llms import PredictionGuard\n",
"from langchain import PromptTemplate, LLMChain"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "kp_Ymnx1SnDG"
},
"outputs": [],
"source": [
"# Optional, add your OpenAI API Key. This is optional, as Prediction Guard allows\n",
"# you to access all the latest open access models (see https://docs.predictionguard.com)\n",
"os.environ[\"OPENAI_API_KEY\"] = \"<your OpenAI api key>\"\n",
"\n",
"# Your Prediction Guard API key. Get one at predictionguard.com\n",
"template = \"\"\"Respond to the following query based on the context.\n",
"\n",
"Context: EVERY comment, DM + email suggestion has led us to this EXCITING announcement! 🎉 We have officially added TWO new candle subscription box options! 📦\n",
"Exclusive Candle Box - $80 \n",
"Monthly Candle Box - $45 (NEW!)\n",
"Scent of The Month Box - $28 (NEW!)\n",
"Head to stories to get ALLL the deets on each box! 👆 BONUS: Save 50% on your first box with code 50OFF! 🎉\n",