Model API Quickstart

This quickstart shows you how to install your SDK of choice and then make your first Bytez API request.

Install

Using Python 3.9+, JavaScript, or Julia, install the appropriate package:

pip install bytez

Run Inference

Get your API Key by signing up on Bytez, then navigating to Settings in your account.

from bytez import Bytez

client = Bytez("YOUR_BYTEZ_KEY_HERE")

model = client.model("Qwen/Qwen2-7B-Instruct")

model.load()

input_text = "Once upon a time there was a beautiful home where"

model_params = {"max_new_tokens": 20, "max_new_tokens": 5, "temperature": 0.5}

result = model.run(input_text, model_params=model_params)

output = result["output"]

generated_text = output[0]["generated_text"]

print(generated_text)
Something not right or need another API Key? DM our team in Disocrd and we’ll resolve.

Demo