Skip to content

Commit a5b552d

Browse files
committed
Update Groq tests and tapes
1 parent f410d5b commit a5b552d

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

packages/inference/test/InferenceClient.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,8 +1687,13 @@ describe.concurrent("InferenceClient", () => {
16871687
() => {
16881688
const client = new InferenceClient(env.HF_GROQ_KEY ?? "dummy");
16891689

1690-
HARDCODED_MODEL_ID_MAPPING["groq"] = {
1691-
"meta-llama/Llama-3.3-70B-Instruct": "llama-3.3-70b-versatile",
1690+
HARDCODED_MODEL_INFERENCE_MAPPING["groq"] = {
1691+
"meta-llama/Llama-3.3-70B-Instruct": {
1692+
hfModelId: "meta-llama/Llama-3.3-70B-Instruct",
1693+
providerId: "llama-3.3-70b-versatile",
1694+
status: "live",
1695+
task: "conversational",
1696+
},
16921697
};
16931698

16941699
it("chatCompletion", async () => {

packages/inference/test/tapes.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7456,5 +7456,56 @@
74567456
"server": "UploadServer"
74577457
}
74587458
}
7459+
},
7460+
"5688b06e0eb91dd68eef47fad94783b8b38a56cceae637c57521a48d4711ff2d": {
7461+
"url": "https://api.groq.com/openai/v1/chat/completions",
7462+
"init": {
7463+
"headers": {
7464+
"Content-Type": "application/json"
7465+
},
7466+
"method": "POST",
7467+
"body": "{\"messages\":[{\"role\":\"user\",\"content\":\"Say 'this is a test'\"}],\"stream\":true,\"model\":\"llama-3.3-70b-versatile\"}"
7468+
},
7469+
"response": {
7470+
"body": "data: {\"id\":\"chatcmpl-f3f09b15-5394-4b39-bd41-5b30c9ba741e\",\"object\":\"chat.completion.chunk\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01js27cen2f5brg46sjpmn0z3m\"}}\n\ndata: {\"id\":\"chatcmpl-f3f09b15-5394-4b39-bd41-5b30c9ba741e\",\"object\":\"chat.completion.chunk\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"This\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f3f09b15-5394-4b39-bd41-5b30c9ba741e\",\"object\":\"chat.completion.chunk\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f3f09b15-5394-4b39-bd41-5b30c9ba741e\",\"object\":\"chat.completion.chunk\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" a\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f3f09b15-5394-4b39-bd41-5b30c9ba741e\",\"object\":\"chat.completion.chunk\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" test\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f3f09b15-5394-4b39-bd41-5b30c9ba741e\",\"object\":\"chat.completion.chunk\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\".\"},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f3f09b15-5394-4b39-bd41-5b30c9ba741e\",\"object\":\"chat.completion.chunk\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"x_groq\":{\"id\":\"req_01js27cen2f5brg46sjpmn0z3m\",\"usage\":{\"queue_time\":0.220723924,\"prompt_tokens\":42,\"prompt_time\":0.010160524,\"completion_tokens\":6,\"completion_time\":0.021818182,\"total_tokens\":48,\"total_time\":0.031978706}}}\n\ndata: [DONE]\n\n",
7471+
"status": 200,
7472+
"statusText": "OK",
7473+
"headers": {
7474+
"alt-svc": "h3=\":443\"; ma=86400",
7475+
"cache-control": "no-cache",
7476+
"cf-cache-status": "DYNAMIC",
7477+
"connection": "keep-alive",
7478+
"content-type": "text/event-stream",
7479+
"server": "cloudflare",
7480+
"transfer-encoding": "chunked",
7481+
"vary": "Origin, Accept-Encoding"
7482+
}
7483+
}
7484+
},
7485+
"01cb4504b502c793085788df0984db81d4f72532cebe5862d9558b0cbf07519c": {
7486+
"url": "https://api.groq.com/openai/v1/chat/completions",
7487+
"init": {
7488+
"headers": {
7489+
"Content-Type": "application/json"
7490+
},
7491+
"method": "POST",
7492+
"body": "{\"messages\":[{\"role\":\"user\",\"content\":\"Complete this sentence with words, one plus one is equal \"}],\"model\":\"llama-3.3-70b-versatile\"}"
7493+
},
7494+
"response": {
7495+
"body": "{\"id\":\"chatcmpl-76a3744d-bc7c-4153-900b-99d189af3720\",\"object\":\"chat.completion\",\"created\":1744905321,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"two.\"},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"queue_time\":0.218711445,\"prompt_tokens\":47,\"prompt_time\":0.010602797,\"completion_tokens\":3,\"completion_time\":0.010909091,\"total_tokens\":50,\"total_time\":0.021511888},\"usage_breakdown\":{\"models\":null},\"system_fingerprint\":\"fp_3f3b593e33\",\"instance_id\":\"LLAMA-33-70B-DMM1-PROD2-1\",\"x_groq\":{\"id\":\"req_01js27cen0fafs6j9xp8w18nfm\"}}",
7496+
"status": 200,
7497+
"statusText": "OK",
7498+
"headers": {
7499+
"alt-svc": "h3=\":443\"; ma=86400",
7500+
"cache-control": "private, max-age=0, no-store, no-cache, must-revalidate",
7501+
"cf-cache-status": "DYNAMIC",
7502+
"connection": "keep-alive",
7503+
"content-encoding": "br",
7504+
"content-type": "application/json",
7505+
"server": "cloudflare",
7506+
"transfer-encoding": "chunked",
7507+
"vary": "Origin, Accept-Encoding"
7508+
}
7509+
}
74597510
}
74607511
}

0 commit comments

Comments
 (0)