-
-
Notifications
You must be signed in to change notification settings - Fork 7
Large Language Models
UralicNLP provides a seamless, unified interface to access a variety of powerful large language models, eliminating the need for separate installations or complex setups. With UralicNLP, you can effortlessly switch between different LLMs, saving time and simplifying your workflow while gaining the flexibility to work with the model that best suits your needs—all through a single, streamlined platform.
To put it simply, you can just do:
llm.prompt("my fancy prompt")
>>"Result from LLM"
To use ChatGPT, you need to pip install openai
from uralicNLP.llm import get_llm
llm = get_llm("chatgpt", "YOUR API KEY", model="gpt-4o")
llm.prompt("What is Skolt Sami?")
>>"Skolt Sami is a Uralic, Sami language spoken by the Skolt Sami people, a small indigenous Finno-Ugric ethnic group ..."
To use Gemini, you need to pip install google-generativeai
. Get the API key from AI Studio.
from uralicNLP.llm import get_llm
llm = get_llm("gemini", "YOUR API KEY", model="gemini-1.5-flash")
llm.prompt("What is Erzya?")
>>"Erzya is a **Finno-Ugric language** and the **cultural identity** of the **Erzya people**, one of the two main groups within the Mordvinic people. ..."
To use Mistral, you need to pip install mistralai
from uralicNLP.llm import get_llm
llm = get_llm("mistral", "YOUR API KEY", model="mistral-small-latest")
llm.prompt("What is Komi-Zyrian?")
>>"Komi-Zyrian, often simply referred to as Komi, is a Uralic language spoken in the Komi Republic and some other regions of Russia. ..."
To use models from Hugging Face, you need to pip install transformers
from uralicNLP.llm import get_llm
llm = get_llm("microsoft/Phi-3.5-mini-instruct")
llm.prompt("What is Livonian?")
>>"What is Livonian? Livonian is an extinct Finnic language that was histor"
UralicNLP is an open-source Python library by Mika Hämäläinen