Skip to content

About

Set up your local AI-powered dev environment just like professional AI Engineers

Resources

Stars

87 stars

Watchers

3 watching

Forks

Latest commit

Β 

History

87 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘‹ Interactive Dev Environment (IDE) for AI Engineers

AI Engineer Setting Up Dev Env

Getting Started πŸ—οΈ Building, 🚒 Shipping, and πŸš€ Sharing Production LLM Applications!!

πŸ›£οΈ Welcome to the beginning of your journey to become an AI Engineer!

This tutorial is designed to guide you through the process of setting up your Interactive Development Environment (IDE) to align with best-practices at The LLM Edge!

πŸ€– AI Editors Supported

Note: If you prefer Cursor, Codex, or another tool, then you'll be on your own in terms of debugging.

πŸ–₯️ Operating Systems Supported

  • Windows
  • Linux (Debian/Ubuntu)
  • macOS Intel
  • macOS Apple Silicon

πŸ› οΈ Basic Concepts and Code

We will be using a few core tools in our stack such as a terminal, Command Line Interface (CLI), git, uv, and pip.

Terminal and Command Line Interface

We must use both terminal and a Command Line Interface (CLI) to develop AI applications with open-source tools. This is true regardless of our operating system.

A terminal is a software application like macOS Terminal or Windows Terminal that gives you a window where you type text-based commands and receive text-based output.

A Command Line Interace (CLI) refers to the environment or shell (e.g., Bash, Zsh, PowerShell, etc.) that interprets your text commands. The CLI is the program that actually runs commands and processes input/output; it just happens to run inside a terminal application (or emulator).

Here is a quick review of some terminal commands that you should make sure you know! It's important to understand both syntax and what they do!

Command Stands For Description
ls long listing lists all files and directories in the present working directory
ls -a long listing all lists hidden files as well
cd {dirname} change directory to change to a particular directory
cd ~ change directory home navigate to HOME directory
cd .. change directory up move one level up
cat {filename} concatenate displays the file content
sudo superuser allows regular users to run programs with the security privileges of the superuser or root
mv {filename} {newfilename} move renames the file to new filename
clear clear clears the terminal screen
mkdir {dirname} make directory create new directory in present working directory or at specified path
rm {filename} remove remove file with given filename
touch {filename}.{ext} touch create new empty file
rmdir {dirname} remove directory deletes a directory
ssh {username}@{ip-address} or {hostname} secure shell login into a remote Linux machine using SSH
Git

Git is a free and open source distributed version control system designed to handle everything from small to very large projects. These are the commands we will be using with git:

git clone -> clone a remote repository to your local computer

git add -> add files to a commit

git commit -m {message} -> commit changes with a message

git push -> push commit to remote repository

uv

uv is an extremely fast Python package manager and virtual environment management tool, written in Rust. uv aims to be a drop-in replacement for pip and pip-tools, providing significantly improved performance. We will use uv to manage both our package installations and virtual environments.

Some common uv commands:

uv init -> Initializes a new Python project and generates a pyproject.toml.

uv add <package-name> -> Adds a package dependency to pyproject.toml.

uv run python your_script.py -> Runs a Python script inside the project environment without requiring manual activation.

Note: In most AIM repositories, the required dependencies are already defined in pyproject.toml, so you typically will not need to run uv init or uv add unless you are modifying or extending the project.

Optional:

uv venv .venv -p 3.11 -> Creates a virtual environment in .venv using Python 3.11.

source .venv/bin/activate -> Activates the virtual environment for your current shell session. This is optional if you use uv run.

πŸš€ Let's Get Started!

Let's start off by setting up our environment! Review the environment setup instructions for the local environment that you'll be using in this course.

Windows
wsl --install

(If you find yourself getting stuck on the WSL2 install, here is a link to video instructions)

Give it a test drive!

WindowsTerminal

Continue by installing the following tools using Windows Terminal to setup your environment.

Tool Purpose Command
🐍 uv (installed in WSL2) Python Package Manager `curl -LsSf https://astral.sh/uv/install.sh
:octocat: Git (installed in WSL2) Version Control sudo apt update && sudo apt upgrade
sudo apt install git-all
πŸ“ VS Code (installed in Windows) Development Environment Download
πŸ“ Cursor Development Environment Download
Linux (Debian/Ubuntu)

Open terminal using Ctrl+Shift+T. Enter the following commands in terminal to setup your environment.

Tool Purpose Command
🐍 uv Python Package Manager `curl -LsSf https://astral.sh/uv/install.sh
:octocat: Git Version Control sudo apt update && sudo apt upgrade
sudo apt install git-all
πŸ“ VS Code Development Environment Download
πŸ“ Cursor Development Environment Download
macOS Intel

To get started, we need to download the MacOS package manager, Homebrew 🍺, so that we can download the tools we'll be using in the course. If you don't already have Homebrew installed, run the following commands:

  1. Open terminal using ⌘+Space and type terminal.

  2. Install Homebrew using the command below, following the command prompts:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  3. Update Homebrew (This may take a few minutes)

    git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

    git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch

  4. Install the wget command to continue following along brew install wget

Enter the following commands in terminal to setup your environment.

Tool Purpose Command
🐍 uv Python Package Manager `curl -LsSf https://astral.sh/uv/install.sh
:octocat: Git Version Control brew install git
πŸ“ VS Code Development Environment Download
πŸ“ Cursor Development Environment Download
macOS Apple Silicon

To get started with uv on Apple Silicon, we'll install it directly with our terminal.

Open terminal using ⌘+Space and type terminal. Enter the following commands in terminal to setup your environment.

First, let's install Homebrew if you don't already have it installed:

  1. Install Homebrew using the command below, following the command prompts:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  2. Update Homebrew (This may take a few minutes)

    git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

    git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch

  3. Install the wget command to continue following along brew install wget

  4. Install the xcode-select command-line utilities by typing the following command in the terminal

    xcode-select --install

Now let's install uv and other tools:

Tool Purpose Command
🐍 uv Python Package Manager `curl -LsSf https://astral.sh/uv/install.sh
:octocat: Git Version Control brew install git
πŸ“ VS Code Development Environment Download
πŸ“ Cursor Development Environment Download

πŸ§‘β€πŸ’» Let's configure our VS Code environment!

Install the Python and Jupyter Notebook Extensions
  1. Click the Extensions tab on the left side of the window.

  2. Type "Python" in the search bar.

  3. Click Install on the Python extension

  4. Then, type "Jupyter" in the search bar.

  5. Click Install on the Microsoft Jupyter Notebook Extension

Set the Python Interpreter
  1. Open Cursor (or VS Code) and click on New File...

  2. Open the Command Pallette (Mac: Shift⌘+P , Windows: Ctrl+Shift+P)

  3. Type "Python" in the search bar.

  4. Click on New Python File

  5. Open the Command Pallette again. Can you remember the shortcut? If not, see #2 above again.

  6. Type "Python Interpreter".

  7. Click on Python: Select Interpreter

  8. Select the Python environment that was created by uv.

  1. Now you're ready to start coding!

πŸ”‘ Setting Up Keys and Tokens

Generating a GitHub Access Token

Create an account with GitHub here if you do not have one.

Navigate to GitHub's Developer Token settings. Click on Generate new token > Generate new token (classic) Screenshot 2023-08-30 at 8 16 58 PM

Give the token a description, set the expiration (we recommend 90 days), and check every box. When you're done, click Generate token at the bottom of the page.

Screenshot 2023-08-30 at 8 36 14 PM

Copy the access token and save it for later use. We will use this token to interact with GitHub. Please do not lose this access token or you will need to generate a new one.

image

Generating an OpenAI API key

Create an account with OpenAI here if you do not have one.

Navigate to OpenAI's API Developer settings and click on + Create new secrete key. image

Name your key and click Create secret key image

Copy the key and save it for later use. We will use this key several times in deploying projects. Please do not lose this key or you will need to generate a new one

image

We recommend your run through our OpenAI Notebook to learn how to utilize the OpenAI API.

Generating a Claude API key

Create an account with Claude AI (anthropic.com) here if you do not have one.

Navigate to Anthropic's Dashboard and click on Get API keys NOTE: If you have not purchased credits yet, it will require you to purchase at least $5.00 worth before continuing. Claude Actions

Enter a key name (or accept the default) and click on Create API Key Claude Create API Key

Click the Copy button and save the key somewhere that is secure. We will use this key several times in deploying projects. As stated in the modal, Keep a record of your API key, you wont be able to view it again.

Claude Save API Key

If you want to test the api key first, copy the example code and paste it into a terminal. The results will look something like this: Claude API Key Test Results

Let's Make Sure That GitHub is Ready to Roll!

Github SSH Setup Secure Shell Protocol (SSH) provides a secure communication channel of an unsecured network. Let's set it up!

  1. Generate a Private/Public SSH Key Pair.
ssh-keygen -o -t rsa -C "your email address for github"
  1. Save file pair. Default location ~/.ssh/id_rsa is fine!

  2. At the prompt, type in a secure passphrase.

  3. Copy the contents of the public key that we will share with GitHub.

    • Mac: pbcopy < ~/.ssh/id_rsa.pub

    • Windows (WSL): clip.exe < ~/.ssh/id_rsa.pub

    • Linux: xclip -sel c < ~/.ssh/id_rsa.pub

  4. Go to your GitHub account and go to Settings.

  5. Under Access, click on the SSH and GPG keys tab on the left.

image

  1. Click on the New SSH Key button.

image

  1. Name the key, and paste the public key that you copied. Click the Add SSH Key button

image

Build Your First LLM Application

Now that you've completed your IDE set-up, head on over to the The-AI-Engineer-Challenge repository to build your first LLM application!

About

Set up your local AI-powered dev environment just like professional AI Engineers

Resources

Stars

87 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors