| 1 | import { LLMOptions } from "../../index.js"; |
| 2 | |
| 3 | import OpenAI from "./OpenAI.js"; |
| 4 | |
| 5 | class Cerebras extends OpenAI { |
| 6 | static providerName = "cerebras"; |
| 7 | static defaultOptions: Partial<LLMOptions> = { |
| 8 | apiBase: "https://api.cerebras.ai/v1/", |
| 9 | }; |
| 10 | maxStopWords: number | undefined = 4; |
| 11 | |
| 12 | private static modelConversion: { [key: string]: string } = { |
| 13 | "llama3.1-8b": "llama3.1-8b", |
| 14 | "llama3.1-70b": "llama3.1-70b", |
| 15 | "llama-4-scout-17b-16e-instruct": "llama-4-scout-17b-16e-instruct", |
| 16 | }; |
| 17 | protected _convertModelName(model: string): string { |
| 18 | return Cerebras.modelConversion[model] ?? model; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export default Cerebras; |