Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hizkifw/lmrouter

experimental language model router and load balancer
https://github.com/hizkifw/lmrouter

Last synced: about 1 month ago
JSON representation

experimental language model router and load balancer

Awesome Lists containing this project

README

        

# lmrouter

Just like [AI Horde](https://stablehorde.net/) but specifically for low-latency
streaming text generation using ephemeral inference servers.

## Usage

```sh
# Build the project
go build .

# Run the server
./lmrouter server --listen :9090

# Run the agent
./lmrouter agent --hub ws://localhost:9090 --inference http://localhost:5000
```

## How it works

![diagram](.github/images/diagram.png)

lmrouter consists of two components, server and agent. Server acts as the hub,
and will route incoming inference requests to any available agent. Agents will
run in the inference server close to where the inference API is hosted.

The agents will be making an outbound websocket connection to the server, so
there is no need to port forward agent nodes.

## Features

Implemented:

- `/v1/completions` endpoint
- `/v1/models` endpoint
- SSE streaming for completions endpoint
- Automatic selection of agent based on available models

To-do:

- `/v1/chat/completions` endpoint