Adding Cerebras related info

This commit is contained in:
Sahand Sojoodi 2024-10-08 15:57:44 -04:00
parent 3aee3ca08c
commit 487ea20a14
6 changed files with 90 additions and 5 deletions

7
core/index.d.ts vendored
View file

@ -644,7 +644,9 @@ type ModelProvider =
| "sambanova"
| "nvidia"
| "vllm"
| "mock";
| "mock"
| "cerebras";
export type ModelName =
| "AUTODETECT"
@ -683,6 +685,9 @@ export type ModelName =
// Llama 3
| "llama3-8b"
| "llama3-70b"
// Llama 3.1
| "llama3.1-8b"
| "llama3.1-70b"
// Other Open-source
| "phi2"
| "phind-codellama-34b"

20
core/llm/llms/Cerebras.ts Normal file
View file

@ -0,0 +1,20 @@
import { LLMOptions, ModelProvider } from "../../index.js";
import OpenAI from "./OpenAI.js";
class Cerebras extends OpenAI {
static providerName: ModelProvider = "cerebras";
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://api.cerebras.ai/v1/",
};
maxStopWords: number | undefined = 4;
private static modelConversion: { [key: string]: string } = {
"llama3.1-8b": "llama3.1-8b",
"llama3.1-70b": "llama-3.1-70b",
};
protected _convertModelName(model: string): string {
return Cerebras.modelConversion[model] ?? model;
}
}
export default Cerebras;

View file

@ -11,6 +11,7 @@ import Anthropic from "./Anthropic";
import Azure from "./Azure";
import Bedrock from "./Bedrock";
import BedrockImport from "./BedrockImport";
import Cerebras from "./Cerebras";
import Cloudflare from "./Cloudflare";
import Cohere from "./Cohere";
import DeepInfra from "./DeepInfra";
@ -77,6 +78,7 @@ const LLMs = [
Vllm,
SambaNova,
Mock,
Cerebras,
];
export async function llmFromDescription(

View file

@ -0,0 +1,20 @@
# Cerebras Inference
Cerebras Inference uses specialized silicon to provides fast inference for the Llama3.1 8B and Llama3.1 70B models.
1. Create an account in the portal [here](https://cloud.cerebras.ai/).
2. Create and copy the API key for use in Continue.
3. Update your Continue config file:
```json title="config.json"
{
"models": [
{
"title": "Cerebras Llama 3.1 70B",
"provider": "cerebras",
"model": "llama3.1-70b",
"apiKey": "YOUR_API_KEY"
}
]
}
```

View file

@ -194,7 +194,8 @@
"openrouter",
"sambanova",
"nvidia",
"vllm"
"vllm",
"cerebras"
],
"markdownEnumDescriptions": [
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)",
@ -224,7 +225,8 @@
"### IBM watsonx\nwatsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks.",
"### OpenRouter\nOpenRouter offers a single API to access almost any language model. To get started, obtain an API key from [their console](https://openrouter.ai/settings/keys).",
"### NVIDIA NIMs\nNVIDIA offers a single API to access almost any language model. To find out more, visit the [LLM APIs Documentation](https://docs.api.nvidia.com/nim/reference/llm-apis).\nFor information specific to getting a key, please check out the [docs here](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog)",
"### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server."
"### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server.",
"### Cerebras\nCerebras Inference uses specialized silicon to provides superfast inference. To get started, get your API keys from [their console](https://cloud.cerebras.ai/)."
],
"type": "string"
},
@ -1142,6 +1144,23 @@
}
}
},
{
"if": {
"properties": {
"provider": {
"enum": ["cerebras"]
}
},
"required": ["provider"]
},
"then": {
"properties": {
"model": {
"enum": ["llama3.1-8b", "llama3.1-70b"]
}
}
}
},
{
"if": {
"properties": {

View file

@ -194,7 +194,8 @@
"openrouter",
"sambanova",
"nvidia",
"vllm"
"vllm",
"cerebras"
],
"markdownEnumDescriptions": [
"### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)",
@ -224,7 +225,8 @@
"### IBM watsonx\nwatsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks.",
"### OpenRouter\nOpenRouter offers a single API to access almost any language model. To get started, obtain an API key from [their console](https://openrouter.ai/settings/keys).",
"### NVIDIA NIMs\nNVIDIA offers a single API to access almost any language model. To find out more, visit the [LLM APIs Documentation](https://docs.api.nvidia.com/nim/reference/llm-apis).\nFor information specific to getting a key, please check out the [docs here](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog)",
"### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server."
"### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server.",
"### Cerebras\nCerebras Inference uses specialized silicon to provides superfast inference. To get started, get your API keys from [their console](https://cloud.cerebras.ai/)."
],
"type": "string"
},
@ -1142,6 +1144,23 @@
}
}
},
{
"if": {
"properties": {
"provider": {
"enum": ["cerebras"]
}
},
"required": ["provider"]
},
"then": {
"properties": {
"model": {
"enum": ["llama3.1-8b", "llama3.1-70b"]
}
}
}
},
{
"if": {
"properties": {