Skip to content

naskio/mergeui

Repository files navigation

title emoji colorFrom colorTo sdk sdk_version python_version app_file fullWidth header disable_embedding startup_duration_timeout license language datasets tags short_description thumbnail pinned
MergeUI
🧬
purple
pink
gradio
4.31.5
3.9
mergeui/web/gradio_app/main.py
true
mini
false
15m
apache-2.0
en
open-llm-leaderboard/results
merge
leaderboard
mergekit
lazymergekit
All-in-one UI for merged LLMs in Hugging Face Hub
true

MergeUI

All-in-one UI for merged LLMs in Hugging Face

MergeUI is an open-source project that aims to provide a user-friendly interface for discovering and analyzing merged large language models (Merged LLMs) from the Hugging Face Hub. It is particularly focused on models that have been merged using MergeKit.

Development

Requirements

To run the project locally, you need to have the following installed:

Setup

Once you have the requirements installed, you can set up the project by running the following commands:

poetry install

Once the dependencies are installed, make sure to set up the environment variables by creating a .env file

cp .env.example .env

Tip

Find more about the environment variables in the settings.py file.

Next, we need to launch the database and Redis using Docker Compose:

docker compose up -d

Tip

run docker compose down to stop these services when you are done.

Run

Note

This project use poetry with Poe the Poet plugin to run commands, run poe to see all available commands.

Once the setup is complete, we need to index the models from the Hugging Face Hub and store them in the database.

Indexing

For indexing models we use RQ:

  • First we need to launch some workers by running the following command in separate terminal tabs:
    poe worker
  • Next, we can start the indexing process by running:
    poe index
  • To monitor the indexing process, we can use the RQ dashboard by running:
    rq-dashboard

Important

The indexing process takes few minutes to complete depending on your resources, number of workers and number of merge models available.

Note

It takes around 6 minutes to index a graph of ~12k models and ~51k relationships using 64 workers.

Visualisation

Once the indexing process is complete, we can start our app using the following command:

FastAPI server with a Gradio app

uvicorn mergeui.main:app --port 8000 --log-level trace

FastAPI only (dev mode)

Warning

Set environment variable GRADIO_APP_DISABLED to true to disable Gradio app.

uvicorn mergeui.main:app --reload --port 8000 --log-level debug

Gradio app only (dev mode)

gradio mergeui/web/gradio_app/main.py # with reloading
python mergeui/web/gradio_app/main.py # without reloading

Bokeh server (dev mode)

poe bokeh_dev

Testing

This project use pytest for testing, you can run the tests using the following command:

poe test

Contributing

MergeUI is a new project, and any contribution would make a difference! Whether you find a bug, have valuable feedback or suggestions, or simply want to get involved, we would love to hear from you!