Azure / Azure/agentic-cli-for-aks
No llm models were loadederror when not specifying `--model` parameter
- Dominant language
- No language data
- Stars
- 11
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
# No llm models were loaded error when not specifying `--model` parameter
## Environment
- **aks-agent version:** 1.0.0b11
- **Azure CLI version:** 2.81.0
- **OS:** Linux
## Description
When running `az aks agent` without the `--model` parameter, the agent fails with "No llm models were loaded" even though the config file (`~/.azure/aksAgent.yaml`) is valid and contains correct Azure OpenAI credentials.
## Steps to Reproduce
1. Configure LLM via `az aks agent-init` or manually create `~/.azure/aksAgent.yaml`:
```yaml
llms:
- provider: azure
MODEL_NAME: gpt-4.1
AZURE_API_KEY:
AZURE_API_BASE: https://.openai.azure.com/
AZURE_API_VERSION: 2025-01-01-preview
```
2. Run without `--model`:
```bash
az aks agent "test" --no-interactive
```
3. Observe error:
```
No llm models were loaded
ERROR: Failed to create AI executor: No llm models were loaded
```
## Expected Behavior
The agent should load the model from the config file automatically.
## Actual Behavior
The model is not loaded. Debug output shows:
```
INFO: cli.azext_aks_agent.agent.llm_config_manager: Using provider: azure, model: None, Env vars setup successfully.
```
## Suspected Root Cause
In `azext_aks_agent/custom.py`, the `export_model_config()` function returns the model string, but it's not captured:
```python
llm_config_manager.export_model_config(llm_config) # Returns model but not captured!
aks_agent_internal(
...
model, # This is still None from command line args
...
)
```
Should be:
```python
model = llm_config_manager.export_model_config(llm_config) or model
```
## Workaround
Explicitly pass the `--model` parameter:
```bash
az aks agent "test" --model azure/gpt-4.1
```
## Additional Context
- The Azure OpenAI deployment is correctly configured (verified via direct API call)
- The config file is correctly parsed (verified via Python yaml.safe_load)
- Environment variables are correctly set by `export_model_config()`
- The issue is specifically that the model name is not passed to the Holmes config
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.