simonw / llm-reka

Access Reka models via the Reka API
Apache License 2.0
9 stars 1 forks source link

Initial plugin #1

Closed simonw closed 2 months ago

simonw commented 2 months ago

Access the Reka models - "reka-core", "reka-edge", "reka-flash" - via their API, using their Python client library.

simonw commented 2 months ago

I used this code to check the list of models:

@llm.hookimpl
def register_commands(cli):
    @cli.command()
    def reka_models():
        key = llm.get_key("", "reka", "LLM_REKA_KEY")
        if not key:
            raise click.ClickException("No Reka API key found")
        reka.API_KEY = key
        models = reka.list_models()
        click.echo("Reka models:")
        for model in models:
            click.echo(f"  {model}")
simonw commented 2 months ago

This works but doesn't yet support conversation mode. It's also not streaming, because the Reka API library for Python doesn't support streaming.

simonw commented 2 months ago

I need to add conversation support.

simonw commented 2 months ago

Demo:

llm -m reka-edge 'say hi in spanish'

In Spanish, there are several ways to say "hi" depending on the context and the level of formality. Here are a few options:

  1. Hola - This is the most common and general way to say "hi" in Spanish. It is suitable for both formal and informal situations. Example: Hola, ¿cómo estás? (Hi, how are you?)

  2. Buenos días - This is used to greet someone in the morning. Example: Buenos días, ¿cómo va tu día? (Good morning, how is your day going?)

  3. Buenas tardes - This is used to greet someone in the afternoon. Example: Buenas tardes, ¿qué tal estás? (Good afternoon, how are you?)

  4. Buenas noches - This is used to greet someone in the evening or at night. Example: Buenas noches, ¿has tenido un buen día? (Good evening, have you had a good day?)

Remember to adapt your greeting based on the context and the relationship you have with the person you are addressing.

llm -c 'and say i like cheese'

To say "I like cheese" in Spanish, you can use the following phrases:

  1. Me gusta el queso - This is the most common and straightforward way to express your liking for cheese. Example: Me gusta el queso, ¿tú también lo disfrutas? (I like cheese, do you also enjoy it?)

  2. Soy fanático/fanática del queso - This phrase means "I am a fan of cheese" and is a more enthusiastic way to express your liking. Example: Soy fanático del queso, no puedo resistirme a un buen trozo. (I am a fan of cheese, I can't resist a good piece.)

  3. Adoro el queso - This phrase means "I adore cheese" and conveys a strong liking for cheese. Example: Adoro el queso, especialmente el azul. (I adore cheese, especially blue cheese.)

Remember to adjust the gender and number agreement of the noun