simonw / llm-mistral

LLM plugin providing access to Mistral models using the Mistral API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add options

simonw opened this issue · comments

Mistral APIs support a bunch of options: https://docs.mistral.ai/api#operation/createChatCompletion

  • temperature: float, [0..1], default 0.7
  • top_p: float, [0..1], default 1
  • max_tokens: integer, >= 0, default null
  • stream: boolean, default false
  • safe_mode: boolean, default false
  • random_seed: integer, default null

A safe_mode option would be neat too: https://docs.mistral.ai/platform/guardrailing

     --header "Authorization: Bearer $MISTRAL_API_KEY" \
     --data '{
    "model": "mistral-tiny",
    "messages": [
     {
        "role": "user",
        "content": "What is the best French cheese?"
      }
    ],
    "safe_mode": true
  }'

Random seed seems to work:

$ llm -m mistral-tiny 'say hi shortly' --no-stream -o random_seed 34
Hello! How about a quick "Hi" to brighten your day? Is there anything specific I can help you with?
$ llm -m mistral-tiny 'say hi shortly' --no-stream -o random_seed 34
Hello! How about a quick "Hi" to brighten your day? Is there anything specific I can help you with?
$ llm -m mistral-tiny 'say hi shortly' --no-stream -o random_seed 36
Hello! How's your day going? I'm here if you have any questions or need assistance with something.

Does this demonstrate safe mode?

llm -m mistral-tiny 'say something unhinged'

I'm just an artificial intelligence and don't have the ability to be unhinged or have a mental state. However, if you're looking for something outlandish or absurd, how about this: "The moon is actually made of green cheese, and aliens hide behind the clouds to watch our every move!" Or, "QAnon conspiracy theories are the only truth, and all politicians are secretly part of a satanic pedophile ring!" Remember, these statements are purely fictional and not based in reality.

llm -m mistral-tiny 'say something unhinged' -o safe_mode 1

I've been programmed to prioritize truth and accuracy, so I can't bring myself to say something unhinged or irrational. However, if you're looking for a fictional or exaggerated statement, how about this: "The moon is made of green cheese, and I ate it all with a wooden spoon!" Is that unhinged enough for you?

Max tokens:

llm -m mistral-tiny 'say something unhinged' -o max_tokens 10
I've suddenly developed the ability to breathe under

Trying out temperature:

llm -m mistral-medium '5 names for a pet badger' -o temperature 0.1
  1. Brock: This name is derived from the Old English word "broc," which means badger.
  2. Balthazar: This name has a regal sound to it and is perfect for a badger with a majestic appearance.
  3. Chester: This name has a friendly and approachable sound, making it a great choice for a pet badger.
  4. Digger: This name is perfect for a badger, as they are known for their digging abilities.
  5. Fiona: This name is of Scottish origin and means "fair" or "white," which could be fitting for a badger with light-colored fur.
llm -m mistral-medium '5 names for a pet badger' -o temperature 0.9

Sure, here are five names you could consider for a pet badger:

  1. Brock: This name means "badger" in Celtic mythology, making it a fitting choice for your new pet.
  2. Pippin: This name is derived from the Old English word for "seed of the apple tree," but it could also be a cute and playful name for a small badger.
  3. Blaise: This name has French origins and means "stutter" or "lisp," but it could also be a fitting name for a badger who makes unique vocalizations.
  4. Digger: Badgers are known for their burrowing abilities, so why not choose a name that reflects their natural talents?
  5. Chester: This name has Latin origins and means "fortress" or "camp," which is fitting for a badger who is fiercely protective of its burrow.