Create the .env file for API keys

The .env file is where you store the API-keys for your LLMs is located in the ~/Test/notebooks directory.

Prerequisites

A PC or laptop running Ubuntu 22.04 with Nano or any other kind of text-editor installed is required.

What tou will do

Step 1: Create the .env file in ~\Test\notebooks.

Create the .env file

The idea is very simple. Create a .env file with tour text-editor and create the key description to retrieve the key with the Python code in the cell.

StepAction
1Goto notebooks folder: cd ~\Test\notebooks.
2Create the file with Nano: sudo nano .env
2Type the API-key name, followed by your key: OPENAIAPIKEY='<replace with the OpenAI API-key>'
3Save the file: Ctrl+O.
4Leave Nano: Ctrl+X.
5Check the content of the file: cat .env.

Summary

This guide describes how to create a .env file in the ~/Test/notebooks directory to store API keys for Large Language Models (LLMs). It requires an Ubuntu 22.04 PC/laptop with a text editor (Nano is recommended). The process involves navigating to the directory, creating the .env file using Nano, adding the API key (e.g., OPENAIAPIKEY='<your_key>'), saving, exiting, and verifying the file's contents.