Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/maxmekiska/llmnet

A library designed to harness diversity of thought by combining multiple LLMs.
https://github.com/maxmekiska/llmnet

consensus diversity llm network thought

Last synced: 26 days ago
JSON representation

A library designed to harness diversity of thought by combining multiple LLMs.

Awesome Lists containing this project

README

        

# `llmnet`

llmnet is a library designed to facilitate collaborative work among LLMs on diverse tasks. Its primary goal is to encourage a diversity of thought across various LLM models.

llmnet comprises two main components:

1. LLM network workers
2. Consensus worker

The LLM network workers can independently and concurrently process tasks, while the consensus worker can access the various solutions and generate a final output. It's important to note that the consensus worker is optional and doesn't necessarily need to be employed.

## Example

### Prerequisite

llmnet currently supports LLM models from OpenAI and Google. The user can define the model to be used for the LLM workers, as well as the model to be used for the consensus worker.

Please make sure to set env variables called `OPENAI_API_KEY`, `GOOGLE_API_KEY` to your OpenAi and Google keys.

### How to use llmnet?

#### llm worker

You have currently three llm worker at your disposal:

1. openaillmbot
2. googlellmbot
3. randomllmbot
4. randomopenaillmbot
5. randomgooglellmbot

##### `openaillmbot`

Interface with OpenAi models.

optional parameters:

```
model (str) = 'gpt-3.5-turbo'
max_tokens (int) = 2024
temperature (float) = 0.1
n (int) = 1
stop (Union[str, List[str]]) = None
```

##### `googlellmbot`

Interface with Google models.

optional parameters:

```
model (str) = 'gemini-pro'
max_output_tokens (int) = 2024
temperature (float) = 0.1
top_p (float) = None
top_k (int) = None
candidate_count (int) = 1
stop_sequences (str) = None
```

##### `randomllmbot`

Select randomly between all available llmworkers and parameter specified.

optional parameters:

```
random_configuration (Dict) = {}
```

example dict:

```
{
"":
{
"": [],
"": [],
...
},
"":
{
"": [],
"": []
...
}
...
}
```

##### `randomopenaillmbot`

Select randomly between all configurations possible for OpenAi based llms.

optional parameters - if not provided, defaults to `openaillmbot` default values:

```
random_configuration (Dict) = {}
```

example dict:

```
{
"": [],
"": [],
...
}
```

##### `randomgooglellmbot`

Select randomly between all configurations possible for Google based llms.

optional parameters - if not provided, defaults to `googlellmbot` default values:

```
random_configuration (Dict) = {}
```

example dict:

```
{
"": [": [