Skip to content

LoRA-backed Components #104

@nrfulton

Description

@nrfulton

Components should be able to specify aLoRA routing behavior, generalizing the way in which aLoRA requirements are currently handled by Backends (see Reference A below) -- but with the choice of alora living in Component instead of in the backed.

So, for example:

class Component:
    ...
    alora_name : str | None = "rag_query_rewrite"


    alora_template : ... = ...

And then in the Backend we check if the Component has an alora_name; if it does, we look for that alora (by name) and use it. We need to think about how that works with the actual loading of the aloras.

While we are doing this we should also consider whether we should have a Component.render method which handles outputes from models.

Reference A

        match action:
            case ALoraRequirement():
                alora_for_this_request = (
                    self.get_alora("constraint")
                    if action.alora is None
                    else action.alora
                )
            case _:
                alora_for_this_request = self.get_alora("constraint")
                assert alora_for_this_request is not None, (
                    "This code block should not execute unless there is a 'constraint' alora loaded."
                )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions