Skip to content

gr-repo/ai-hello-world

Repository files navigation

AI Hello World

This is a public repository with a set of getting started guides that run completely in GitHub Codespaces. This repo calls public LLM's so if you run this on your computer in a corporate be aware that you will be sending data out to the public internet.

See the notebooks folder there's a folder per technology/subject.

Suggested Path

  1. How to add an environmental secret
  2. Development environment before running code
  3. Run openai_1_hello_world.ipynb to test connectivity. Most calls are into Open AI so do this first to sort out connectivity and api key isses.
  4. Start exploring notebooks folders
  5. Keep an eye on Monitor costs

Setup Steps

Open AI Setup

How to create a new Open AI API Key

  1. Goto API Keys: https://platform.openai.com/settings/organization/api-keys
  2. Create new secret key

How to add more models to call into

  1. Go to Settings: https://platform.openai.com/settings/organization/general
  2. Click SECOND "Limit" menu heading, there are two on the list in the RHS.
  3. On "Project limits" page...
  4. Under "Model usage" > "Allowed models" click Edit
  5. Select models you want to add/remove

Codespaces Setup

NOTE: Running Codespaces has a cost implications that hits the user running the application. If your account is linked to a corporate account they will not necessarily pick up the cost. This cost is mininal and the Codespaces auto-turn themselves off. See GitHub Codespaces billing

How too add an env secret

  1. Browse to the code repo > settings > Secrets and variables > Codespaces: https://github.com/YOURREPOSITORYNAME/settings/secrets/codespaces
  2. Click: Add new repository key
  3. Create key, don't use quotes on value
  4. If you have the Codespace running you may need to restart it and wait a couple of minutes

How to run a new Codespace in the browser

  1. Browse to GitHub Codespaces
  2. Click "Use this template" under Jupyter Notbook
  3. A new space will spin up that is a fork of Visual Studio Code
  4. This runs in a container on GitHub Codespaces outside of corporate networks.

How to run a Codespace off a repository

  1. Browse to a repo: https://github.com/gr-repo/ai-hello-world
  2. Click the green "Code" button
  3. Click "Codespaces" tab
  4. Choose your Codespace option (i.e., + to create a new one)
  5. This runs in a container on GitHub Codespaces outside of corporate networks.

How work in Visual Studio Code Desktop but run the Codespace from the cloud

  1. You can edit code in VS Code but the app runs in the cloud
  2. Browse to Codespaces
  3. Scroll down to existing Codespaces you have created
  4. Click the "..."
  5. Select "Open in Visual Studio Code"
  6. This runs in a container on GitHub Codespaces outside of corporate networks.

Development environment before running code

  1. Go to MySettings to see what settings are required. You can override these manually in the MySettings class or setup your environment. The default is to pull from GitHub Codespaces dev env.
  2. Run Editable Package Installation
    1. This makes files under "src" behave as packages so you can import them using
    2. Open Terminal
    3. Go to project rool /workspaces/ai-hell-world
    4. Run "pip install -e ."

Monitor Costs

  1. OpenAI Usage
  2. Codespaces Usage

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors