Batch Priority
Prioritize certain batch jobs over others using the metadata field.
How It Works
Usage
from openai_batch import Batch
with Batch() as batch:
for i in range(100):
batch.add_to_batch(
model="NousResearch/DeepHermes-3-Mistral-24B-Preview",
messages=[{"role": "user", "content": f"Prompt #{i}"}]
)
batch.submit(metadata={"PARASAIL_PRIORITY": "1"})from openai import OpenAI
client = OpenAI(
base_url="https://api.saas.parasail.io/v1",
api_key="$PARASAIL_API_KEY",
)
batch = client.batches.create(
input_file_id="file-abc123",
endpoint="/v1/chat/completions",
completion_window="24h",
metadata={
"PARASAIL_PRIORITY": "1"
}
)Notes
Last updated