discourse-ai/lib/completions/dialects
Roman Rizzi 4f1a3effe0
REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588)
Both endpoints provide OpenAI-compatible servers. The only difference is that Vllm doesn't support passing tools as a separate parameter. Even if the tool param is supported, it ultimately relies on the model's ability to handle native functions, which is not the case with the models we have today.

As a part of this change, we are dropping support for StableBeluga/Llama2 models. They don't have a chat_template, meaning the new API can translate them.

These changes let us remove some of our existing dialects and are a first step in our plan to support any LLM by defining them as data-driven concepts.

 I rewrote the "translate" method to use a template method and extracted the tool support strategies into its classes to simplify the code.

Finally, these changes bring support for Ollama when running in dev mode. It only works with Mistral for now, but it will change soon..
2024-05-07 10:02:16 -03:00
..
chat_gpt.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
claude.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
command.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
dialect.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
fake.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
gemini.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
mistral.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
open_ai_tools.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00
xml_tools.rb REFACTOR: Migrate Vllm/TGI-served models to the OpenAI format. (#588) 2024-05-07 10:02:16 -03:00