Copied to Clipboard
Once the tools are installed — login to the console:
az login
Then run the Azure setup scripts:
./setup-azure-phi.sh
./get-azure-phi-creds.sh
The Azure console should look something like this:
Running the Python Code
First- switch the directory with the Python version of the MCP sample code. Run the release version on the local system:
cd adk-litellm$ make install
Processing ./.
Verify The ADK Installation
First- verify the ADK is installed:
xbill@penguin:~/gemini-cli-aws/adk-litellm$adk --version
adk, version 1.32.0
To check the ADK setup, run the ADK CLI locally with the hello Agent. This is a basic Hello World style agent. No external tools or MCP calls are used in the Agent code- which allows the ADK installation to be checked:
xbill@penguin:~/gemini-cli-azure/adk-litellm-azure$adk run agents/azure
Log setup complete: /tmp/agents_log/agent.20260505_133501.log
To access latest log: tail -F /tmp/agents_log/agent.latest.log
/home/xbill/.local/lib/python3.13/site-packages/google/adk/cli/cli.py:204: UserWarning: [EXPERIMENTAL] InMemoryCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
credential_service = InMemoryCredentialService()
/home/xbill/.local/lib/python3.13/site-packages/google/adk/auth/credential_service/in_memory_credential_service.py:33: UserWarning: [EXPERIMENTAL] BaseCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
super(). __init__ ()
Running agent azure_agent, type exit to exit.
13:35:04 - LiteLLM:INFO: utils.py:4011 -
LiteLLM completion() model= phi-4-mini;provider = azure_ai
Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.
13:35:14 - LiteLLM:INFO: utils.py:4011 -
LiteLLM completion() model= phi-4-mini;provider = azure_ai
[azure_agent]: Hello! How can I assist you today?
[user]: what are your model details
13:35:23 - LiteLLM:INFO: utils.py:4011 -
LiteLLM completion() model= phi-4-mini;provider = azure_ai
[azure_agent]: Hello! I am Phi, developed by Microsoft, and I'm here to help you with information, answer questions, and assist with a wide range of topics. How may I be of service to you?
Test The ADK Web Interface
This step tests the ADK agent interactions with a browser:
xbill@penguin:~/gemini-cli-azure/adk-litellm-azure/agents$adk web --host 0.0.0.0
2026年05月05日 13:39:05,375 - INFO - service_factory.py:266 - Using in-memory memory service
2026年05月05日 13:39:05,375 - INFO - local_storage.py:84 - Using per-agent session storage rooted at /home/xbill/gemini-cli-azure/adk-litellm-azure/agents
2026年05月05日 13:39:05,376 - INFO - local_storage.py:110 - Using file artifact service at /home/xbill/gemini-cli-azure/adk-litellm-azure/agents/.adk/artifacts
/home/xbill/.local/lib/python3.13/site-packages/google/adk/cli/fast_api.py:204: UserWarning: [EXPERIMENTAL] InMemoryCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
credential_service = InMemoryCredentialService()
/home/xbill/.local/lib/python3.13/site-packages/google/adk/auth/credential_service/in_memory_credential_service.py:33: UserWarning: [EXPERIMENTAL] BaseCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
super(). __init__ ()
INFO: Started server process [15609]
INFO: Waiting for application startup.
+-----------------------------------------------------------------------------+
| ADK Web Server started |
| |
| For local testing, access at http://0.0.0.0:8000. |
+-----------------------------------------------------------------------------+
Then use the web interface — either on the local interface 127.0.0.1 or the catch-all web interface 0.0.0.0 -depending on your environment:
Special note for Google Cloud Shell Deployments- add a CORS allow_origins configuration exemption to allow the ADK agent to run:
adk web --host 0.0.0.0 --allow_origins 'regex:.*'
Phi Models on Azure
Microsoft Phi models are a family of highly capable, cost-effective Small Language Models (SLMs) designed for low-latency generative AI, available on Azure AI Foundry. They support text, image, and audio inputs (Phi-4-multimodal) and are ideal for memory-constrained environments. Key models include Phi-4, Phi-3.5-MoE, and Phi-3-mini/medium, optimized for high-performance reasoning tasks.
More details are here:
Deep Dive with a Phi Model
Once the connection has been tested. You can drill into the model:
xbill@penguin:~/gemini-cli-azure/adk-litellm-azure$adk run agents/azure
Log setup complete: /tmp/agents_log/agent.20260505_134754.log
To access latest log: tail -F /tmp/agents_log/agent.latest.log
/home/xbill/.local/lib/python3.13/site-packages/google/adk/cli/cli.py:204: UserWarning: [EXPERIMENTAL] InMemoryCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
credential_service = InMemoryCredentialService()
/home/xbill/.local/lib/python3.13/site-packages/google/adk/auth/credential_service/in_memory_credential_service.py:33: UserWarning: [EXPERIMENTAL] BaseCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
super(). __init__ ()
Running agent azure_agent, type exit to exit.
[user]: what model are you
13:48:00 - LiteLLM:INFO: utils.py:4011 -
LiteLLM completion() model= phi-4-mini;provider = azure_ai
[azure_agent]: I am Phi, an AI developed by Microsoft, designed to help you with a wide range of queries and tasks. How can I assist you today?
and deep model details:
10:29:49 - LiteLLM:INFO: utils.py:4011 -
LiteLLM completion() model= phi-4-mini;provider = azure_ai
[azure_agent]: My model knowledge was last updated in October 2023. Please note that I can't access or retrieve real-time data, so my information may not include events or developments that occurred after this date. For the most current and accurate information, I recommend referring to the latest sources.
One Last Code Review with Gemini CLI
Gemini CLI was used to summarize the project:
> code review adk agent for phi model
✦ I've reviewed the Azure agent implementation in agents/azure/agent.py. Overall, the implementation correctly utilizes the ADK (Agent Development
Kit) and integrates with Azure AI Foundry via LiteLLM.
🔍 Code Review Findings
1. ADK Best Practices
* Missing description: While the name is correctly defined, the description parameter is missing. In ADK, the description is critical for
multi-agent systems, as it helps routers and other agents understand when to delegate tasks to this specific agent.
* Minimal instruction: The current instruction is very brief. ADK best practices suggest using Markdown for clarity and being more specific
about the agent's persona and constraints.
* Short request_timeout: The timeout is set to 10 seconds. For LLM inferences, especially via serverless endpoints which may have occasional
cold starts or latency, 30 seconds is generally more reliable.
2. Azure AI Foundry Integration
* Model String: The model string azure_ai/phi-4-mini is correctly formatted for LiteLLM to recognize the Azure AI Foundry provider.
* Environment Variables: The code correctly leverages AZURE_MODEL with a fallback. It assumes AZURE_AI_API_KEY and AZURE_AI_API_BASE are set in
the environment, which matches the setup-azure-phi.sh automation script.
3. Code Quality
* Imports: Clean and follows standard ADK patterns.
* Encapsulation: Using root_agent as the export in agent.py (and re-exporting in __init__.py) is the standard pattern for ADK's discovery
mechanism.
Summary
The strategy for using the ADK with Azure LLMs was validated with a incremental step by step approach.
First- the basic environment tools were configured. Then the required Python libraries were installed. LiteLLM was used to proxy the Google ADK to a Model hosted on Azure. Finally, some tests were run from the CLI and the Web interface. Gemini CLI was used to validate the approach.