Ironclad / rivet

The open-source visual AI programming environment and TypeScript library
https://rivet.ironcladapp.com
MIT License
2.55k stars 226 forks source link

[Feature]: Add support for Mistral AI API #326

Closed ai-made-approachable closed 5 months ago

ai-made-approachable commented 5 months ago

Feature Request

Mistral is offering an API now (based on OpenAPIs API). Interesting thing is that mistral-small (Mixtral-8x7b) outperforms ChatGPT 3.5 and is cheaper (0,0018 €/1k Tokens instead of 0,0020 €/1k Tokens for gpt 3.5-turbo). So it makes only sense to support it as an alternative.

Note: Currently use is NOT possible with the existing chat-node: The API fails if you add the fields "frequence_penalty" and "presence penalty" and there is no way to not send them via Rivet Chat node.

Example:

{
    "object": "error",
    "message": "{\"detail\":[{\"type\":\"extra_forbidden\",\"loc\":[\"body\",\"frequency_penalty\"],\"msg\":\"Extra inputs are not permitted\",\"input\":1,\"url\":\"https://errors.pydantic.dev/2.5/v/extra_forbidden\"}]}",
    "type": "internal_error_proxy",
    "param": null,
    "code": "1000"
}

Code of Conduct

ai-made-approachable commented 5 months ago

Link to Mistral documentation: https://docs.mistral.ai

ai-made-approachable commented 5 months ago

Idea: Add all integrations that use the Open AI API format as templates for the chat-node So you would first select the provider, e.g. "OpenAI" or "Mistral" and than depending on that provider you have slightly different options for the node. E.g. no presence_penalty + frequency_penalty parameters for Mistral

abrenneke commented 5 months ago

Overloading the chat node like that would make it ever more complicated than it already is unfortunately... I'll have to think of a good solution that doesn't overcomplicate the node...

abrenneke commented 5 months ago

In 70fa4cea9f25a6c82a2c9ec7fa1f7ef8d1624ec5 you can remove the presence penalty and frequency penalty params and they don't get sent to the API. By default they're unset, as well.