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
@@ -31,6 +31,7 @@ def start_server(app):
|
||||
|
||||
# These paths must match the routes in the frontend SPA
|
||||
# file: frontend/src/routes/index.js
|
||||
@server.route('/models')
|
||||
@server.route('/chat')
|
||||
@server.route('/agent')
|
||||
@server.route('/chat/<path:subpath>')
|
||||
@@ -167,6 +168,21 @@ def start_server(app):
|
||||
)
|
||||
await send({'message': "agent updated", 'agentId': agent_id, 'nonce': nonce})
|
||||
|
||||
elif action == "get-models":
|
||||
await send({
|
||||
'models': [{"id": model.id, "name": model.name} for model in await app.get_models()],
|
||||
'nonce': nonce
|
||||
})
|
||||
|
||||
elif action == "save-model":
|
||||
model = await app.save_model(
|
||||
model_id=body.get("modelId"),
|
||||
name=body["name"],
|
||||
kind=body["kind"],
|
||||
value=body["value"],
|
||||
)
|
||||
await send({'message': "model saved", 'modelId': model.id, 'nonce': nonce})
|
||||
|
||||
elif action == "get-agent-config-fields":
|
||||
await send({'fields': await app.get_agent_config_fields(body['agentId']), 'nonce': nonce})
|
||||
|
||||
|
||||
Reference in new issue
Block a user