Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

The Developer's Guide to AI - From Prompts to Agents

Python Primer

Porting the Getting Started example to Python.

Quick Start

The following steps will get you up and running on your machine.

  1. Install Ollama and run:
  • Download and install: https://ollama.com
  • Verify the install and start Llama in a terminal window:
~ % ollama run llama3.2
  1. Clone this project into a local directory:
~ % git clone <url>
  1. Install Python (if necessary)

It's recommended that you setup a virtual environment before installing Python or Python modules. You can see how to do that here:

Python Virtual Environment

If you would rather install Python globally, follow the instructions here:

~ % python -V
  • If the installation succeeded, the version will print
  1. Install Python modules
  • Navigate to the project part1/getting_started_python directory in your terminal and run:
~/developers-guide-to-ai/part1/getting_started_python % pip install -r requirements.txt
  • Navigate to the project part1/client directory in your terminal and run:
~/developers-guide-to-ai/part1/client % npm install
  1. Launch the server
  • In a terminal, navigate to the part1/getting_started_python directory and run the following command:
~/developers-guide-to-ai/part1/getting_started_python % fastapi dev main.py
  1. Launch the client
  • In a separate terminal, navigate to the part1/client directory and run the following commands:
~/developers-guide-to-ai/part1/client % npm run dev
  1. Open your web browser and visit: http://localhost:5173

  2. Input a question and click Call your API to see the response streamed from Llama 3.2 3B