mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-17 06:17:39 +00:00
3.5 KiB
3.5 KiB
In [ ]:
import os
from langchain.llms import ForefrontAI
from langchain import PromptTemplate, LLMChainIn [ ]:
# get a new token: https://docs.forefront.ai/forefront/api-reference/authentication
from getpass import getpass
FOREFRONTAI_API_KEY = getpass()In [ ]:
os.environ["FOREFRONTAI_API_KEY"] = FOREFRONTAI_API_KEYIn [ ]:
llm = ForefrontAI(endpoint_url="YOUR ENDPOINT URL HERE")In [ ]:
template = """Question: {question}
Answer: Let's think step by step."""
prompt = PromptTemplate(template=template, input_variables=["question"])In [ ]:
llm_chain = LLMChain(prompt=prompt, llm=llm)In [ ]:
question = "What NFL team won the Super Bowl in the year Justin Beiber was born?"
llm_chain.run(question)