2024-04-05 23:05:00 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from .Openai import Openai
|
|
|
|
from ...typing import AsyncResult, Messages
|
|
|
|
|
|
|
|
class Groq(Openai):
|
2024-04-20 08:43:53 +00:00
|
|
|
label = "Groq"
|
2024-04-05 23:05:00 +00:00
|
|
|
url = "https://console.groq.com/playground"
|
|
|
|
working = True
|
|
|
|
default_model = "mixtral-8x7b-32768"
|
2024-10-21 15:39:06 +00:00
|
|
|
models = [
|
|
|
|
"distil-whisper-large-v3-en",
|
|
|
|
"gemma2-9b-it",
|
|
|
|
"gemma-7b-it",
|
|
|
|
"llama3-groq-70b-8192-tool-use-preview",
|
|
|
|
"llama3-groq-8b-8192-tool-use-preview",
|
|
|
|
"llama-3.1-70b-versatile",
|
|
|
|
"llama-3.1-8b-instant",
|
|
|
|
"llama-3.2-1b-preview",
|
|
|
|
"llama-3.2-3b-preview",
|
|
|
|
"llama-3.2-11b-vision-preview",
|
|
|
|
"llama-3.2-90b-vision-preview",
|
|
|
|
"llama-guard-3-8b",
|
|
|
|
"llava-v1.5-7b-4096-preview",
|
|
|
|
"llama3-70b-8192",
|
|
|
|
"llama3-8b-8192",
|
|
|
|
"mixtral-8x7b-32768",
|
|
|
|
"whisper-large-v3",
|
|
|
|
"whisper-large-v3-turbo",
|
|
|
|
]
|
2024-04-05 23:05:00 +00:00
|
|
|
model_aliases = {"mixtral-8x7b": "mixtral-8x7b-32768", "llama2-70b": "llama2-70b-4096"}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def create_async_generator(
|
|
|
|
cls,
|
|
|
|
model: str,
|
|
|
|
messages: Messages,
|
|
|
|
api_base: str = "https://api.groq.com/openai/v1",
|
|
|
|
**kwargs
|
|
|
|
) -> AsyncResult:
|
|
|
|
return super().create_async_generator(
|
|
|
|
model, messages, api_base=api_base, **kwargs
|
2024-10-21 15:39:06 +00:00
|
|
|
)
|