KDercksen / castel_workshop_llms

Some examples of LLM usage in Python and some other resources.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In the examples for this workshop, we will use the OpenAI and Together APIs. For both of these, you need an API key. You can get an OpenAI API key here. You can get a Together API key here.

Create a .env file in the root directory of this project and add the following:

# .env
OPENAI_API_KEY=<your key here>
TOGETHER_API_KEY=<your key here>

Install the required Python dependencies (inside a virtual environment):

pip install -r requirements.txt

Scripts included

Script Description
make_data.py Create a dataset of short stories using ChatGPT. The data from this script is used in estimate_cost.py
estimate_cost.py Estimate the cost of generating a set of short stories using ChatGPT. Run make_data.py first.
how_to_prompt.py Examples of querying OpenAI and Together.AI LLMs through API.
modalities_plot.ipynb Simulation of cost and duration of serverless vs dedicated machine.

Resources

About

Some examples of LLM usage in Python and some other resources.


Languages

Language:Jupyter Notebook 96.2%Language:Python 3.8%