Simple FastAPI project — Bedrock Gateway API (local development instructions)
- Python 3.11
- Create a virtual environment using Python 3.11:
cd /Users/sung0/Desktop/Hai_project.ai/fastapi
python3.11 -m venv .venv- Activate the virtual environment:
source .venv/bin/activate- Upgrade packaging tools and install dependencies:
python -m pip install -U pip setuptools wheel
pip install -r requirements.txtYou can run using uvicorn (recommended for development with auto-reload):
source .venv/bin/activate
uvicorn main:app --reload --host 127.0.0.1 --port 8000Or using python directly:
source .venv/bin/activate
python main.pyBy default the app will listen on 127.0.0.1:8000. Visit http://127.0.0.1:8000/docs for the OpenAPI UI.
- The project expects AWS credentials for Bedrock-related calls if you use the Bedrock endpoints. For local dev, either set
AWS_REGIONand credentials in environment variables or mock the client. - Add
.venv/to your.gitignore(already included).