Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Project Setup Using Poetry and FastAPI

Steps to Create an AI Project Step 1: Initialize the Project Create a project using Poetry:

  poetry new your_project_name --name app
  cd your_project_name
  poetry shell 
  • Note: If you want to run your project locally, you can select the kernel (virtual environment) that you created by using the Poetry shell. Inside the project directory, create a Dockerfile. Step 2: Setup Docker Compose Create a file named compose.yaml with the necessary configuration. Run the Docker Compose command to set up the environment:

    docker compose up
    

Add necessary packages to pyproject.toml in the devcontainer. To add the OpenAI package, use:

  poetry add openai

Step 3: Write and Run Code Write all the code in a Jupyter Notebook file (.ipynb). Run the cells in the Jupyter Notebook to execute the code.

Important Notes

  • API Keys Security: OpenAI keys must be deleted after the project is complete.

  • Environment Variables:

  • Store the keys in a .env file.

  • Create a file named .backupenv. If working on a client project, the client should rename .backupenv to .env and write their API keys in this file.

  • Git Ignore: Ensure the .env file is included in .gitignore to prevent sensitive information from being committed to the repository:

     .env
    

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages