mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 11:11:03 +02:00
Add model detection for inference profiles in US and EU
This commit is contained in:
parent
b6dcc484fc
commit
3967d92b8d
1 changed files with 16 additions and 2 deletions
|
|
@ -35,6 +35,7 @@ default_profile = os.getenv("AWS_PROFILE", None)
|
||||||
default_region = os.getenv("AWS_DEFAULT_REGION", None)
|
default_region = os.getenv("AWS_DEFAULT_REGION", None)
|
||||||
|
|
||||||
# Variant API handling depends on the model type
|
# Variant API handling depends on the model type
|
||||||
|
# FIXME: Missing, Amazon models, Deepseek
|
||||||
class ModelVariant(enum.Enum):
|
class ModelVariant(enum.Enum):
|
||||||
MISTRAL = enum.auto() # Mistral
|
MISTRAL = enum.auto() # Mistral
|
||||||
META = enum.auto() # Llama 3.1
|
META = enum.auto() # Llama 3.1
|
||||||
|
|
@ -122,6 +123,9 @@ class Processor(ConsumerProducer):
|
||||||
|
|
||||||
def determine_model(self, model):
|
def determine_model(self, model):
|
||||||
|
|
||||||
|
# FIXME: Missing, Amazon models, Deepseek
|
||||||
|
|
||||||
|
# This set of conditions deals with normal bedrock on-demand usage
|
||||||
if self.model.startswith("mistral"):
|
if self.model.startswith("mistral"):
|
||||||
return ModelVariant.MISTRAL
|
return ModelVariant.MISTRAL
|
||||||
elif self.model.startswith("meta"):
|
elif self.model.startswith("meta"):
|
||||||
|
|
@ -132,8 +136,18 @@ class Processor(ConsumerProducer):
|
||||||
return ModelVariant.AI21
|
return ModelVariant.AI21
|
||||||
elif self.model.startswith("cohere"):
|
elif self.model.startswith("cohere"):
|
||||||
return ModelVariant.COHERE
|
return ModelVariant.COHERE
|
||||||
else:
|
|
||||||
return ModelVariant.DEFAULT
|
# The inference profiles
|
||||||
|
if self.model.startswith("us.meta"):
|
||||||
|
return ModelVariant.META
|
||||||
|
elif self.model.startswith("us.anthropic"):
|
||||||
|
return ModelVariant.ANTHROPIC
|
||||||
|
elif self.model.startswith("eu.meta"):
|
||||||
|
return ModelVariant.META
|
||||||
|
elif self.model.startswith("eu.anthropic"):
|
||||||
|
return ModelVariant.ANTHROPIC
|
||||||
|
|
||||||
|
return ModelVariant.DEFAULT
|
||||||
|
|
||||||
async def handle(self, msg):
|
async def handle(self, msg):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue