Llama-cpp inference, database stored models
This commit is contained in:
1 parent
a3700ca15a
commit
f2a6fc0cd5
11 files changed
+192
-6
No files matched your search
@@ -19,7 +19,7 @@ class ExpertAgent(Agent):
|
||||
description = CLASS_DESCRIPTION
|
||||
schema_fields = [
|
||||
AgentField('system_prompt', 'string', default="You are an expert AI assistant."),
|
||||
AgentField('model', 'string', default="qwen-big"),
|
||||
AgentField('model', 'model_id', default=None),
|
||||
]
|
||||
|
||||
def __init__(self, app, data):
|
||||
@@ -51,7 +51,15 @@ class ExpertAgent(Agent):
|
||||
|
||||
model = self.config['model']
|
||||
|
||||
if model.startswith("ollama:"):
|
||||
if type(model) is int:
|
||||
db_model = await self.app.get_model(model)
|
||||
|
||||
if db_model.value["engine"] == "llama-cpp":
|
||||
response = await inference.local_chat_completion(self.app, messages, model=db_model.value['model'])
|
||||
else:
|
||||
raise Exception("Unknown model: " + repr(model))
|
||||
|
||||
elif model.startswith("ollama:"):
|
||||
response = await inference.ollama_chat_completion(self.app, messages, model=model[7:])
|
||||
elif model == "qwen-big":
|
||||
response = await inference.replicate_qwen_completion(self.app, messages, model=inference.Models.qwen3_235b)
|
||||
|
||||
Reference in new issue
Block a user