Repository navigation
Conversation
Co-authored-by: Andre Luiz de Senna <andre.senna@gmail.com>
…ole in router catalog
|
Regarding my review of this PR, I considered that the Specification attached to the Jira card OMEGA-376 named "Omega LLM Router – General Specification" has been approved. So I approved this PR because it's compliant with that specification. However, I have a consideration regarding the design which I believe must be addressed. Ideally it should be addressed BEFORE merging the PR but optionally it could be addressed in the scope of a follow-up task. My point is that the Router plugin really should have an abstract element used in the main loop. Were we implementing the router in Python it would be just a matter of creating an abstract class in a separate file and let any concrete router extend it. But our router is in MeTTa and, to be honest, I'm not sure what's the best way to implement this type of polymorphism (or something with equivalent effect) in MeTTa. However, I believe the worst-case scenario is just to have the abstract router file define a function (which will be the one called from outside i.e. the public API) and make a sort of switch in this function calling the concrete implementation we want to hook up. In other words, the abstract metta router would work as both: the public API call + a factory method that actually makes the call to the desired concrete router. |
|
Another point that needs to be at least clarified if not addressed. I'm not (hands on) familiar with the use of embedding vectors. But it seems to me like we are persisting embeddings in a DB and if the user switches from one provider to another this persistence may become invalid or corrupted. I mean, perhaps we should change where we persist embedding according to the actual provider being used. I didn't raise this as a "finding" in the PR because I'm not sure it's really an issue. |
Currently if the user switches embedding types (switching Local and OpenAI by rerunning the script or resetting the value in standalone mode) there will be incompatibilities. So it's in essence an existing issue. We could devise some kind of guardrails but the point is the LLM router doesn't really change the nature of the problem. It could still happen. It's just that with the router there is more than one provider. We only retrieve text back from the LLM now, so whether memory is converted to embeddings using OpenAI's tools or the local embeddings (which we get from huggingface I think), either works (local embeddings or OpenAI). It's just that you can't switch one to the other. So it really needs some kind of guardrailing anyway, and also Nebiyu has an idea of conversion too. |
In practical terms the concern seems "to be avoid the need of changing anything outside plugins/routers in order to implement and setup new routers". The design I created will not require changing anything outside the plugins/router for a new router. That is, except the script, which is only set up now in a transition phase. The script will need to be modified to accommodate really using more expansive routers. But, in standalone mode we should now be able to create custom routers. But if someone sees hardcoded terms in Omega proper (not the script) then I need to fix it. I worked hard to try to make this generalized (whether "abstract" enough, I don't know...). The design idea proposed above seems fine to me, more like using an abstract Python class than using MeTTa code. I think it would indeed be possible to slip in a Python class as most of the design now has a MeTTa module that calls a Python module of the same name, just with a .py suffix. So it can still be done probably, however my belief is that it will be pretty easy to create a new router with just MeTTa. |
|
Tested: this PR at 3de57f6, built into an image and started in three ways, all on IRC: with the launcher from the same commit, with a bare What I checked
Issues
Note
Verdict: FAIL. Routing works with a router catalog, but the old ways of starting the agent and several router cases are broken. |
andre-senna
left a comment
There was a problem hiding this comment.
@alyona-snet @jazzbox35 @TossSky
After the latest modifications, this PR remains compliant with the specifications outlined in "Omega LLM Router – General Specification". Therefore, I am approving the changes. However, I did not verify whether these changes effectively resolved the issues raised in #419 (comment)
…is handled completely by the harness which sends its own switch message)
…g models. Only the default prompt works with switching.
|
This should get kicked back to QA now. Thanks |
Description
This PR substantially meets the requirements specified in "phase 1" of implementing an LLM router and catalog.
TLDR: You can now specify a cheap or expensive model. This works with all of our providers.
LLM_Router.pdf
Note: I marked this ready for review since I think the review can commence. But, there are a couple of tweaks still needed that can be discussed.
How Has This Been Tested?
It does appear to work fine using the usual script and also a regular "docker run" command. Still needs testing under standalone install.
Checklist