If you have used Claude Code, Cursor, or OpenAI Codex, you have already experienced Agentic AI, whether it is coding an application, creating a quick script, or debugging an issue. The use cases are infinite, and like many, you can easily burn through your token quota when using the latest state-of-the-art Frontier AI models, which are simply amazing!
While spending some time playing with our latest VCF Private AI Services (PAIS) release (here and here), I have also been trading notes with colleagues doing something similar but rolling their own local AI stack using just vSphere Kubernetes Service (VKS) running on VMware Cloud Foundation (VCF) 9.1.1. Through those conversations, I came to learn about Pi, not the number, but a lightweight coding agent and agent harness that can connect to a number of AI model providers, including those providing an OpenAI-compatible endpoint.
Since VCF PAIS provides an OpenAI-compatible endpoint that can serve one or more AI models, you can now have your own Agentic AI using Pi running within your on-premises environment using various open weight models! 😎
Requirements:
Step 1 - Install Pi on your local system that has connectivity to the PAIS Model Endpoint URL
Step 2 - Initialize Pi by running pi and then press Ctrl+C to exit. This initial launch will create the .pi directory within your home directory, which we will use in the next step
Step 3 - Create the ~/.pi/agent/models.json file and configure it with the PAIS base URL and model ID, which must match the model ID configured in PAIS. You can also specify additional model settings such as the context window and maximum number of tokens to use
{
"providers": {
"vcf": {
"baseUrl": "https://model.vcf.lab/api/v1/compatibility/openai/v1",
"api": "openai-completions",
"apiKey": "${PAIS_API_KEY}",
"models": [
{
"id": "qwen3.8-27b",
"name": "Qwen 3.8 27B (VCF Lab)",
"reasoning": true,
"input": [
"text"
],
"contextWindow": 60000,
"maxTokens": 4096,
"thinkingLevelMap": {
"minimal": "low",
"low": "low",
"medium": "medium",
"high": "xhigh",
"xhigh": "xhigh",
"max": null
},
"compat": {
"thinkingFormat": "chat-template",
"chatTemplateKwargs": {
"enable_thinking": {
"$var": "thinking.enabled"
},
"reasoning_effort": {
"$var": "thinking.effort",
"omitWhenOff": true
}
}
}
}
]
}
}
}
Step 4 - Set the following environment variables to disable validation of the self-signed TLS certificate and provide the API token required to authenticate with the PAIS Model Endpoint.
export NODE_TLS_REJECT_UNAUTHORIZED=0
export PAIS_API_KEY="..."
Note: The apiKey property in the models.json file references the PAIS_API_KEY environment variable, so make sure the names match.
Step 5 - To launch Pi using your PAIS model, specify the provider ID and model ID configured in the models.json file. In our example, the provider ID is vcf and the model ID is qwen3.8-27b.
pi --model vcf/qwen3.8-27b
You have now successfully connected the Pi coding agent to your PAIS Model Endpoint and can begin interacting with your locally hosted AI model! 🥳
Note: For my setup, I was using an NVIDIA RTX A4000 (20GB VRAM) running the quantized Qwen3.8 27B model (Qwen3.8-27B-UD-Q4_K_S.gguf), which was able to sustain ~15 tokens per second (TPS) and was very usable for the tasks I was performing with Pi. Due to thermal throttling while running the A4000 inside the Minisforum MS-A2, I eventually moved the GPU to another system with better airflow, which eliminated the thermal throttling and its impact on TPS. I recently came to learn about this Local Model Explorer app that someone built that can help you identify models that can run on your specific hardware.
Thanks for the comment!