Skip to content

Commit

Permalink
Add provider cerebras, and update Mistral model availability
Browse files Browse the repository at this point in the history
  • Loading branch information
pkelaita committed Dec 10, 2024
1 parent a771834 commit 7e71b5c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 28 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,25 @@ _Current version: 0.0.36_

### 0.0.37 - December 9, 2024

> [!CAUTION]
> This release has _significant_ breaking changes! Please read the changelog carefully.
#### Added

- Support for [Cerebras](https://www.cerebras.net/) via [Groq](https://www.groq.com/).
- Support for provider [Cerebras](https://cerebras.ai/), offering `llama-3.1-8b` and `llama-3.1-70b`.
- Support for Mistral's `mistral-small`, `ministral-8b`, and `ministral-3b` models via La Plateforme.

#### Changed

- `mistral-large-2` has been renamed to `mistral-large`, to keep up with Mistral's naming scheme. **This is a breaking change!!!** Calls to `mistral-large-2` will fail.

#### Removed

- `mixtral-8x22b`, `mixtral-8x7b`, and `mistral-7b` are no longer available from provider Mistral as they have been [deprecated](https://docs.mistral.ai/getting-started/models/models_overview/). **This is a breaking change!!!** Calls to `mixtral-8x7b` and `mistral-7b` will fail, and calls to `mixtral-8x22b` via provider Mistral will fail.

[!NOTE]

> `mixtral-8x22b` is still available via Groq.
### 0.0.36 - November 21, 2024

Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# L2M2: A Simple Python LLM Manager 💬👍

[![Tests](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml/badge.svg?timestamp=1733805961)](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml) [![codecov](https://codecov.io/github/pkelaita/l2m2/graph/badge.svg?token=UWIB0L9PR8)](https://codecov.io/github/pkelaita/l2m2) [![PyPI version](https://badge.fury.io/py/l2m2.svg?timestamp=1733805961)](https://badge.fury.io/py/l2m2)
[![Tests](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml/badge.svg?timestamp=1733808328)](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml) [![codecov](https://codecov.io/github/pkelaita/l2m2/graph/badge.svg?token=UWIB0L9PR8)](https://codecov.io/github/pkelaita/l2m2) [![PyPI version](https://badge.fury.io/py/l2m2.svg?timestamp=1733808328)](https://badge.fury.io/py/l2m2)

**L2M2** ("LLM Manager" → "LLMM" → "L2M2") is a tiny and very simple LLM manager for Python that exposes lots of models through a unified API. This is useful for evaluation, demos, production applications etc. that need to easily be model-agnostic.

### Features

- <!--start-count-->26<!--end-count--> supported models (see below) – regularly updated and with more on the way.
- <!--start-count-->27<!--end-count--> supported models (see below) – regularly updated and with more on the way.
- Session chat memory – even across multiple models or with concurrent memory streams.
- JSON mode
- Prompt loading tools
Expand Down Expand Up @@ -38,10 +38,11 @@ L2M2 currently supports the following models:
| `claude-3-haiku` | [Anthropic](https://www.anthropic.com/api) | `claude-3-haiku-20240307` |
| `command-r` | [Cohere](https://docs.cohere.com/) | `command-r` |
| `command-r-plus` | [Cohere](https://docs.cohere.com/) | `command-r-plus` |
| `mistral-large-2` | [Mistral](https://mistral.ai/) | `mistral-large-latest` |
| `mixtral-8x22b` | [Mistral](https://mistral.ai/) | `open-mixtral-8x22b` |
| `mixtral-8x7b` | [Mistral](https://mistral.ai/), [Groq](https://wow.groq.com/) | `open-mixtral-8x7b`, `mixtral-8x7b-32768` |
| `mistral-7b` | [Mistral](https://mistral.ai/) | `open-mistral-7b` |
| `mistral-large` | [Mistral](https://mistral.ai/) | `mistral-large-latest` |
| `ministral-3b` | [Mistral](https://mistral.ai/) | `ministral-3b-latest` |
| `ministral-8b` | [Mistral](https://mistral.ai/) | `ministral-8b-latest` |
| `mistral-small` | [Mistral](https://mistral.ai/) | `mistral-small-latest` |
| `mixtral-8x7b` | [Groq](https://wow.groq.com/) | `mixtral-8x7b-32768` |
| `gemma-7b` | [Groq](https://wow.groq.com/) | `gemma-7b-it` |
| `gemma-2-9b` | [Groq](https://wow.groq.com/) | `gemma2-9b-it` |
| `llama-3-8b` | [Groq](https://wow.groq.com/), [Replicate](https://replicate.com/) | `llama3-8b-8192`, `meta/meta-llama-3-8b-instruct` |
Expand Down Expand Up @@ -512,10 +513,10 @@ The following models natively support JSON mode via the given provider:
- `gpt-4-turbo` (via Openai)
- `gpt-3.5-turbo` (via Openai)
- `gemini-1.5-pro` (via Google)
- `mistral-large-2` (via Mistral)
- `mixtral-8x22b` (via Mistral)
- `mixtral-8x7b` (via Mistral)
- `mistral-7b` (via Mistral)
- `mistral-large` (via Mistral)
- `ministral-3b` (via Mistral)
- `ministral-8b` (via Mistral)
- `mistral-small` (via Mistral)

<!--end-json-native-->

Expand Down
34 changes: 18 additions & 16 deletions l2m2/model_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class ModelEntry(TypedDict):
"extras": {},
},
},
"mistral-large-2": {
"mistral-large": {
"mistral": {
"model_id": "mistral-large-latest",
"params": {
Expand All @@ -351,9 +351,9 @@ class ModelEntry(TypedDict):
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
},
},
"mixtral-8x22b": {
"ministral-3b": {
"mistral": {
"model_id": "open-mixtral-8x22b",
"model_id": "ministral-3b-latest",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
Expand All @@ -367,9 +367,9 @@ class ModelEntry(TypedDict):
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
},
},
"mixtral-8x7b": {
"ministral-8b": {
"mistral": {
"model_id": "open-mixtral-8x7b",
"model_id": "ministral-8b-latest",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
Expand All @@ -382,35 +382,37 @@ class ModelEntry(TypedDict):
},
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
},
"groq": {
"model_id": "mixtral-8x7b-32768",
},
"mistral-small": {
"mistral": {
"model_id": "mistral-small-latest",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 2.0,
"max": 1.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": 2**16 - 1,
"max": INF,
},
},
"extras": {},
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
},
},
"mistral-7b": {
"mistral": {
"model_id": "open-mistral-7b",
"mixtral-8x7b": {
"groq": {
"model_id": "mixtral-8x7b-32768",
"params": {
"temperature": {
"default": PROVIDER_DEFAULT,
"max": 1.0,
"max": 2.0,
},
"max_tokens": {
"default": PROVIDER_DEFAULT,
"max": INF,
"max": 2**16 - 1,
},
},
"extras": {"json_mode_arg": {"response_format": {"type": "json_object"}}},
"extras": {},
},
},
"gemma-7b": {
Expand Down
2 changes: 1 addition & 1 deletion tests/l2m2/client/test_base_llm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ async def test_call_mistral(mock_get_extra_message, mock_llm_post, llm_client):
mock_get_extra_message.return_value = "extra message"
mock_return_value = {"choices": [{"message": {"content": "response"}}]}
mock_llm_post.return_value = mock_return_value
await _generic_test_call(llm_client, "mistral", "mixtral-8x7b")
await _generic_test_call(llm_client, "mistral", "mistral-large")


@pytest.mark.asyncio
Expand Down

0 comments on commit 7e71b5c

Please sign in to comment.