WizardLM
A seven billion parameter large language model fine tuned from Llama for general chat tasks.
Deploy WizardLM behind an API endpoint in seconds.
Deploy modelExample usage
This code example shows how to invoke the model using the requests library in Python. The model has a couple of key inputs:
prompt
: The input text sent to the model.max_new_tokens
: Allows you to control the length of the output sequence.
The output of the model is a JSON object which has a key called output
that contains the generated text.
1import requests
2import os
3
4# Replace the empty string with your model id below
5model_id = ""
6baseten_api_key = os.environ["BASETEN_API_KEY"]
7
8data = {
9 "prompt": "What is the most powerful wizard in the world?",
10 "max_new_tokens": 512
11}
12
13# Call model endpoint
14res = requests.post(
15 f"https://model-{model_id}.api.baseten.co/production/predict",
16 headers={"Authorization": f"Api-Key {baseten_api_key}"},
17 json=data
18)
19
20# Print the output of the model
21print(res.json())
1{
2 "output": "What is the most powerful wizard in the world?\n\n ### Response:\n \n Merlin, from the King Arthur legend, is often considered the most powerful wizard in the world of fiction. He is known for his wisdom, magical powers, and his ability to see into the future. Merlin is said to have advised King Arthur and helped him become the legendary ruler of Camelot. His powers include the ability to manipulate time, control the elements, and even shape-shift into various animals. Merlin's story has been retold in many different versions and adaptations, making him one of the most well-known and beloved wizards in literature and popular culture."
3}