Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the new Mistral Large model #5

Closed
simonw opened this issue Feb 26, 2024 · 3 comments
Closed

Support the new Mistral Large model #5

simonw opened this issue Feb 26, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Feb 26, 2024

https://mistral.ai/news/mistral-large/

@simonw simonw added the enhancement New feature or request label Feb 26, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 26, 2024

To figure out the new model IDs:

export MISTRAL=$(cat "$(llm keys path)" | jq .mistral -r)
curl -s 'https://api.mistral.ai/v1/models' -H "Authorization: Bearer $MISTRAL" | jq '.data[].id'

Outputs:

"open-mistral-7b"
"mistral-tiny-2312"
"mistral-tiny"
"open-mixtral-8x7b"
"mistral-small-2312"
"mistral-small"
"mistral-small-2402"
"mistral-small-latest"
"mistral-medium-latest"
"mistral-medium-2312"
"mistral-medium"
"mistral-large-latest"
"mistral-large-2402"
"mistral-embed"

@simonw
Copy link
Owner Author

simonw commented Feb 26, 2024

Current code:

@llm.hookimpl
def register_models(register):
register(Mistral("mistral-tiny"))
register(Mistral("mistral-small"))
register(Mistral("mistral-medium"))

A bit annoying that they don't have a mistral-large alias - the closest is mistral-large-latest.

I'm inclined to keep my existing mistral-tiny and mistral-small and mistral-medium aliases, add my own mistral-large that points to their latest, then make ALL of their model IDs available as things like mistral/mistral-medium-2312.

I'll fetch their JSON file the first time you try to call one of their models and cache it in mistral-models.json, then provide a llm mistral refresh command that refreshes it.

@simonw
Copy link
Owner Author

simonw commented Feb 26, 2024

Extract from the end of that JSON:

  [
    {
      "id": "mistral-large-2402",
      "object": "model",
      "created": 1708960437,
      "owned_by": "mistralai",
      "root": null,
      "parent": null,
      "permission": [
        {
          "id": "modelperm-d7f053a61bc14064b9b3a66c5e2735ed",
          "object": "model_permission",
          "created": 1708960437,
          "allow_create_engine": false,
          "allow_sampling": true,
          "allow_logprobs": false,
          "allow_search_indices": false,
          "allow_view": true,
          "allow_fine_tuning": false,
          "organization": "*",
          "group": null,
          "is_blocking": false
        }
      ]
    },
    {
      "id": "mistral-embed",
      "object": "model",
      "created": 1708960437,
      "owned_by": "mistralai",
      "root": null,
      "parent": null,
      "permission": [
        {
          "id": "modelperm-ccf99400057448afb0567916e545c8a0",
          "object": "model_permission",
          "created": 1708960437,
          "allow_create_engine": false,
          "allow_sampling": true,
          "allow_logprobs": false,
          "allow_search_indices": false,
          "allow_view": true,
          "allow_fine_tuning": false,
          "organization": "*",
          "group": null,
          "is_blocking": false
        }
      ]
    }
  ]

The mistral-embed model doesn't seem to have any metadata that help distinguish it from the non-embedding models, so I'll have to special case that.

@simonw simonw closed this as completed in 1ed0eb7 Feb 26, 2024
simonw added a commit that referenced this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant