📌 Module 2: Your AI Workbench — Setting Up on Windows
1. Theory
A
well-configured environment is the foundation for building and running Agentic AI
applications efficiently.
On Windows, this means:
- Installing the right tools (Python, Git, IDEs)
- Managing virtual environments
- Installing dependencies
- Setting up local or cloud-based LLMs
A proper setup ensures reproducibility — you and others can run the same code with minimal issues.
Why Windows Setup Matters for AI Development
- Many developers in enterprises use Windows by default.
- With WSL2 or native Python, you can still run modern AI frameworks.
- Windows allows both local LLM execution and cloud API integration.
2. Step-by-Step Windows Setup (For This Module)
- Install Python 3.10+
- Download: https://www.python.org/downloads/
- During installation → Check "Add Python to PATH"
- Install Git
- Download: https://git-scm.com/download/win
- Install VS Code
- Download: https://code.visualstudio.com/
- Add Python and Git extensions
- Install Ollama for Local LLMs
- Download: https://ollama.com/download
- Verify with:
o ollama run llama2
- Create Virtual Environment
6. python -m venv agentic_env
7. .\agentic_env\Scripts\activate
- Install Libraries
9. pip install langchain openai requests wikipedia python-dotenv
3. Examples
Example 1 — Running a Local LLM
- Run:
· ollama run llama2
- Type:
· What is Agentic AI?
Example 2 — Testing LangChain Installation
from langchain.prompts import PromptTemplate
template = PromptTemplate(input_variables=["name"], template="Hello {name}, welcome to Agentic AI!")
print(template.format(name="Ajay"))
Example 3 — Using Hugging Face Transformers Locally
from transformers import pipeline
qa = pipeline("question-answering", model="distilbert-base-uncased-distilled-squad")
print(qa(question="What is AI?", context="AI stands for Artificial Intelligence."))
4. Exercises
- Install a different local model in Ollama.
- Create a Python script that checks if all dependencies are installed.
- Set up a VS Code workspace for an Agentic AI project.
5. Best Practices
- Keep your virtual environment per project.
- Use requirements.txt to track dependencies.
6. Common Mistakes
- Forgetting to activate the venv before installing packages.
- Using system Python instead of project-specific venv.
7. Quiz
- Which command activates a virtual environment in PowerShell?
- Name two benefits of using Ollama locally.
- Why should you keep a requirements.txt file?