Programmatic LLM Interaction setup
- Lets create a new folder and cd into it
mkdir basic
cd basic
- Now execute the following command
uv init .
- Lets execute the following command to get the virtual environment
uv sync
# mac or linux
source .venv/bin/activate
# windows
.venv/Scripts/activate
- Now launch visual studio code
code . -
Ensure the following extensions are installed
- python (from microsoft)
- jupyter (from microsoft)

-
Lets add the following packages
uv add langgraph langchain
- Create a file
llm_experiment.ipynb - Now Execute
Ctrl + Shift + Pin windows/linux andCmd+Shift+P>Python: Select Interpreter- Select the
Virtual environmentin local directory.venv/...
- Select the
- Now in jupyter notebook select kernel with Same python environemnt as above and create a cell write a simple python code
print("hello")and Exectute. -
Install Kernel will be prompted once for every new environment
-
Lets set up for GCP Vertex models
uv add "langchain[google-vertexai]"
- Refer Here and select google vertex
LLM Interaction Credentials
- Generally LLMS will have either
- API Keys
- Configuration Steps to create a file which will be used by default
Google Models
- We have 3 options
- Google Gemini
- Google Cloud Refer Here
- Open source Google Models running on your infra (only Gemma Models)
OpenAI
- We have 3 options
- OpenAI
- Azure OpenAI
- Open source OpenAI Models running on your infra (gpt-oss models)
Anthropic Claude Models
- This has many options
- Anthropic
- Azure
- Google Cloud
- AWS Cloud
Setting up Authentication with LLMS
Google Cloud
- Steps:
- Install google cloud cli
gcloud initgcloud auth application-default login
