|
5 | 5 |
|
6 | 6 | Flare AI SDK for Consensus Learning. |
7 | 7 |
|
8 | | -This repository provides a Python implementation of a single-node, multi-model **Consensus Learning (CL)** framework. CL is a decentralized ensemble learning approach described in [arXiv:2402.16157](https://arxiv.org/abs/2402.16157). |
9 | | - |
10 | | -The current implementation specializes in leveraging Large Language Models (LLMs) through a centralized architecture using OpenAI's [OpenRouter](https://openrouter.ai/docs/quick-start). OpenRouter offers access to over 300 models via a unified interface. |
11 | | - |
12 | | -This repository serves as the reference implementation for the **Consensus Learning track** at the **Verifiable AI Hackathon** organized by Google Cloud in collaboration with Flare. For more details, please visit the [main hackathon website](https://hackathon.flare.network/) and [Flare’s blogpost](https://flare.network/flare-x-google-cloud-hackathon/). |
13 | | - |
14 | 8 | ## 🚀 Key Features |
15 | 9 |
|
16 | 10 | - **Consensus Learning:** Provides a Python implementation of a single-node, multi-model of Consensus Learning, a decentralized ensemble learning approach described in [arXiv:2402.16157](https://arxiv.org/abs/2402.16157). |
17 | | -- **Over 300 models supported:** Leverages LLMs via a centralized architecture using OpenAI's [OpenRouter](https://openrouter.ai/docs/quick-start). |
| 11 | +- **Over 300 models supported:** Leverages LLMs via a centralized architecture using [OpenRouter](https://openrouter.ai/docs/quick-start). |
18 | 12 |
|
19 | 13 | ## Prerequisites |
20 | 14 |
|
21 | | -Install all dependencies using [uv](https://docs.astral.sh/uv/getting-started/installation/) by running: |
22 | | - |
23 | | -```bash |
24 | | -uv sync --all-extras |
25 | | -``` |
| 15 | +1. Install all dependencies using [uv](https://docs.astral.sh/uv/getting-started/installation/) by running: |
26 | 16 |
|
27 | | -### OpenAI API Key |
| 17 | + ```bash |
| 18 | + uv sync --all-extras |
| 19 | + ``` |
28 | 20 |
|
29 | | -Generate an [OpenRouter API key](https://openrouter.ai/settings/keys) and set it in your environment variables. You can verify your available credits by running: |
| 21 | +2. Generate an [OpenRouter API key](https://openrouter.ai/settings/keys) and set it in your environment variables. You can verify your available credits by running: |
30 | 22 |
|
31 | | -```bash |
32 | | -uv run python -m tests.credits |
33 | | -``` |
| 23 | + ```bash |
| 24 | + uv run python -m tests.credits |
| 25 | + ``` |
34 | 26 |
|
35 | 27 | ## OpenRouter Endpoints |
36 | 28 |
|
37 | 29 | The repository provides scripts to interact with OpenRouter: |
38 | 30 |
|
39 | | -- **List All Models:** |
40 | | - Retrieves a list of all models. |
41 | | -- **List Free Models:** |
42 | | - Retrieves a list of all free models supported by OpenRouter. |
| 31 | +- **List All Models:** Retrieves a list of all models. |
| 32 | +- **List Free Models:** Retrieves a list of all free models supported by OpenRouter. |
43 | 33 |
|
44 | 34 | Run the following command to generate two JSON files in the `data` folder: |
45 | 35 |
|
46 | 36 | ```bash |
47 | 37 | uv run python -m tests.models |
48 | 38 | ``` |
49 | 39 |
|
50 | | -**Note:** |
51 | | -Free models are limited to 20 requests per minute and 200 requests per day. |
| 40 | +**Note:** Free models are limited to 20 requests/minute and 200 requests/day. |
52 | 41 | Although all models should work in principle, some may return errors. To filter down to working free models, run: |
53 | 42 |
|
54 | 43 | ```bash |
|
0 commit comments