An open API service indexing awesome lists of open source software.

https://github.com/evilfreelancer/moda

Is a framework designed to enhance the performance and flexibility of large language models by dynamically selecting and integrating specialized LoRA adapters based on the input query.
https://github.com/evilfreelancer/moda

adapters gpt llama2 lora router transformers

Last synced: 3 months ago
JSON representation

Is a framework designed to enhance the performance and flexibility of large language models by dynamically selecting and integrating specialized LoRA adapters based on the input query.

Awesome Lists containing this project

README

          

# Mixture of dynamically connected adapters (MoDA)

Mixture of Dynamically Connected Adapters (MoDA) is a framework designed to enhance the performance and flexibility of
large language models by dynamically selecting and integrating specialized adapters based on the input query. This
project facilitates seamless integration and execution of various adapters to optimize responses for different types of
queries.

[Русский](./README.md) | **English**

![moda schema](./assets/moda-schema-v2.png)

## Features

* **Dynamic Adapter Selection** - automatically selects the most appropriate adapter based on the
input query conditions.
* **Multiple Adapter Integration** - supports multiple adapters with distinct functionalities, such
as language-specific or domain-specific tasks.
* **Efficient Resource Utilization** - leverages efficient models and techniques like loading
models in 8-bit to save computational resources.
* **Extensible Framework** - easily add and configure new adapters via a YAML configuration file.

## Configuration

MoDA uses a `config.yml` file to specify the models and adapters. Below is the schema for the configuration file.

```yaml
caller:
name:
load_in_8bit:

socket:
name:
load_in_8bit:

functions:
- name:
prompt:
description:
condition:
chat_template:
```

For a full example, refer to the [config.yml](./config.yml) file located in the root of this repository.

## Usage

To understand how to use MoDA, refer to the [moda.ipynb](./moda.ipynb) Jupyter notebook in the root of this repository.
This notebook provides a comprehensive example of loading models, initializing a conversation, handling function calls,
and dynamically switching between different adapters to process user queries efficiently.

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.

## Citation

```
@misc{moda2024sources,
title={Mixture of dynamically connected adapters (MoDA)},
author={Pavel Rykov},
year={2024}
}
```