localmTUTS
FollowFollowSubscribe
Video Lesson·4 mins

Setup & Resources

Set up your local development environment — the course repository, Python virtual environment, and all three model providers used across the lessons.

Setup & Resources · 4 mins
Instructor:Welcome back to LocalM Tuts. I'm Nilay Parikh. This is lesson 4 of 16. In the last session we cover A2A's architecture. Agent cards, Messages, Task Life cycle, SSE streaming, JSON-RPC methods. If you are watching this as a standalone video, please find the complete course playlist in the description below. This course uses 3 model providers to demonstrate A2A is model agnostic data model. provides Phi-4 with a free GitHub personal access token and a decent daily rate quota. Azure AI foundry host
Instructor:Kimi-K2 and Kimi-K2-Thinking. And many more models. And they do have a free tier, so if you haven't used them you can certainly give a try with them. And the Foundry local where we are running Qwen, the smallest Qwen version and it will be. It will be running entirely on the local machine, so no cloud needed. You can use all of them. You can use, you can choose one of it, or you can bring your own model to test this examples. All 3 models expose OpenAI-compatible API endpoints. So you can use the same OpenAI
Instructor:Python SDK for all of them on the base URL and API key will change. Let us configure. Each provider first GitHub Models. You can sign into the GitHub marketplace model page, find Phi-4 catalog, generate personal access token and make sure you provide the models:read scope. Then set your GitHub token in the environment variable. Its defined is available as a .env.example. You can rename it in the examples, and then replace it. The API endpoint is also going to be most likely same but just double check. Its a
Instructor:models.inference.ai.azure.com Yes that is a GitHub Models API endpoint. It speaks the standard OpenAI chat completion. Next, the Azure Foundry. You can sign it at ai.azure.com or you can actually create a foundry instance from Azure portal as well and deploy the choice of your model, copy the endpoint URL and the API key and set the 2 variables mentioned. At this same endpoint hosts the other models as well. So all you need is to just change the model name. Finally, Foundry Local which also runs
Instructor:the AI model entirely on your local machine using the ONNX runtime. No API key, no cloud account needed. Install the Winget on Windows or brew on Mac, macOS, just install the Python SDK. The Foundry Local manager handles everything. You can also configure them. Using the Visual Studio Code, important of Foundry Local is is a dynamic port assignment at the startup. So always use the manager endpoint, never hardcode a port, but for example that is going. Here is a complete .env file example
Instructor:which you can replace the variable with and the smoke test validation. And once you set all your tokens, you can run the smoke test and it will let you know which model passes and which does not and that's the way you are ready to run the examples. Interactively into the next session from next session we will start the hands-on sessions. Thank you for watching this lesson on the LocalM Tuts In the next session, we will start building your first A2A agent from scratch using Phi-4 and you
Instructor:will find the next video in the A2A protocol course playlist. See you there.
Learning Objectives6
  • Clone the examples repository and create a Python 3.11+ virtual environment
  • Install the A2A Python SDK with HTTP server support
  • Get free Phi-4 access via a GitHub Personal Access Token
  • Activate Kimi-K2 and Kimi-K2-Thinking on Azure AI Foundry
  • Install Foundry Local and run Qwen2.5 Coder on your machine
  • Verify all three providers with the included smoke test script

Step 1 — Repository & Python Environment

0/3

Clone the course repository

Clone the examples repo to your local machine.

bash
git clone https://github.com/nilayparikh/tuts-agentic-ai-examples.git
cd tuts-agentic-ai-examples/a2a

Create a Python 3.11+ virtual environment

Create an isolated environment for the course dependencies.

bash
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS / Linux:
source .venv/bin/activate

Install base dependencies

Install the A2A SDK and all lesson requirements.

bash
pip install -r requirements.txt
# Or install the A2A SDK directly:
pip install "a2a-sdk[http-server]==0.3.24"

Step 2 — GitHub Models (Phi-4)

0/3

Get a GitHub Personal Access Token

Visit github.com/settings/tokens and create a PAT. No special scopes are needed — just a basic token.

Set the GITHUB_TOKEN environment variable

Add this to your shell profile or .env file.

bash
# .env file (or export in your shell)
GITHUB_TOKEN=ghp_your_token_here

Verify GitHub Models access

The endpoint is OpenAI-compatible — uses the openai Python SDK.

python
import os, openai
client = openai.OpenAI(
    base_url="https://models.inference.ai.azure.com",
    api_key=os.environ["GITHUB_TOKEN"],
)
resp = client.chat.completions.create(
    model="Phi-4",
    messages=[{"role": "user", "content": "Hello"}],
    max_tokens=10,
)
print(resp.choices[0].message.content)

Step 3 — Azure AI Foundry (Kimi-K2 / Kimi-K2-Thinking)

0/2

Create an Azure AI Foundry project

Sign in at ai.azure.com, create a project, and deploy the Kimi-K2 and Kimi-K2-Thinking models. Both have a free tier.

Set Azure AI Foundry environment variables

Copy the endpoint URL and API key from the Azure AI Foundry portal.

bash
# .env file
AZURE_AI_FOUNDRY_ENDPOINT=https://your-endpoint.inference.ai.azure.com
AZURE_AI_FOUNDRY_KEY=your_key_here

Step 4 — Foundry Local (Qwen2.5 Coder)

0/2

Install Foundry Local

Foundry Local runs models on your machine using ONNX Runtime. No API key required.

bash
# Windows
winget install Microsoft.FoundryLocal

# macOS
brew install microsoft/foundrylocal/foundrylocal

# Install the Python SDK
pip install foundry-local-sdk

Start the Qwen2.5 Coder model

The endpoint uses a dynamic port — always use manager.endpoint, never hardcode a port.

python
from foundry_local import FoundryLocalManager
import openai

manager = FoundryLocalManager("qwen2.5-coder")
client = openai.OpenAI(
    base_url=manager.endpoint,   # dynamic port
    api_key=manager.api_key,
)
resp = client.chat.completions.create(
    model=manager.get_model_info("qwen2.5-coder").id,
    messages=[{"role": "user", "content": "Hello"}],
    max_tokens=10,
)
print(resp.choices[0].message.content)

Step 5 — Smoke Test

0/1

Run the smoke test script

Verify all three providers respond correctly before starting the coding lessons.

bash
python smoke_test.py
# Expected output:
# ✅ GitHub Phi-4: Hello!
# ✅ Azure Kimi-K2: Hello!
# ✅ Foundry Local Qwen2.5: Hello!