Skip to content

Commit cb8aa46

Browse files
authored
Add Cerebras (#119)
1 parent 6e259b2 commit cb8aa46

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

llm_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def on_token(ctx: llm_request.ApiContext, token: str):
240240
task0_metrics = contexts[0].metrics
241241
if not chosen:
242242
if args.format == FMT_DEFAULT:
243-
print(f"No successful API calls for {init_ctx.name}")
243+
print(f"No successful API calls for {init_ctx.name}. Sample error: {task0_metrics.error}")
244244
return task0_metrics
245245

246246
# Print results.

llm_benchmark_suite.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ def __init__(self, model: str, display_model: Optional[str] = None):
248248
)
249249

250250

251+
class _CerebrasLlm(_Llm):
252+
"""See https://docs.cerebras.ai/en/latest/wsc/Model-zoo/MZ-overview.html#list-of-models"""
253+
254+
def __init__(self, model: str, display_model: Optional[str] = None):
255+
super().__init__(
256+
model,
257+
"api.cerebras.ai/" + (display_model or model),
258+
api_key=os.getenv("CEREBRAS_API_KEY"),
259+
base_url="https://api.cerebras.ai/v1",
260+
)
261+
262+
251263
def _text_models():
252264
AZURE_EASTUS2_OPENAI_API_KEY = os.getenv("AZURE_EASTUS2_OPENAI_API_KEY")
253265
return [
@@ -358,6 +370,7 @@ def _text_models():
358370
_TogetherLlm(
359371
"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo", LLAMA_31_70B_CHAT_FP8
360372
),
373+
_CerebrasLlm("llama3.1-70b", LLAMA_31_70B_CHAT),
361374
# _OvhLlm("llama-3p1-8b-instruct", LLAMA_31_8B_CHAT),
362375
# Llama 3.1 8b
363376
# _DatabricksLlm("databricks-meta-llama-3.1-8b-instruct", LLAMA_31_8B_CHAT),
@@ -371,6 +384,7 @@ def _text_models():
371384
_TogetherLlm(
372385
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo", LLAMA_31_8B_CHAT_FP8
373386
),
387+
_CerebrasLlm("llama3.1-8b", LLAMA_31_8B_CHAT),
374388
# _OvhLlm("llama-3p1-70b-instruct", LLAMA_31_70B_CHAT),
375389
# Llama 3 70b
376390
_DatabricksLlm("databricks-meta-llama-3-70b-instruct", LLAMA_3_70B_CHAT),

0 commit comments

Comments
 (0)