Back to Course
LLM Engineering: Transformers & RAG
Module 13 of 13
13. LLM Cheatsheet
OpenAI API
pythonclient.chat.completions.create( model="gpt-4", messages=[{"role": "user", "content": "Hi"}] )
HuggingFace
pythonpipe = pipeline("text-generation", model="gpt2") pipe("The sky is")
LangChain
pythonprompt = PromptTemplate.from_template("Tell me a {adj} joke") chain = prompt | llm