[AI] AI Observability

[AI] AI Observability

A personal AI infrastructure project centred on LiteLLM and promptfoo, both deployed in the homelab. Presidio redaction, OpenTelemetry observability and hybrid cloud/local model routing are planned integrations.

Litellm API
llm Observability

So basically a big problem right now when using AI locally for personal projects is that I have no idea what the hell it is doing half of the time. Also due to my weird clipboard situation I currently have on Linux sometimes it doesn’t copy when I press control+c so when I’m on autopilot sometimes I’ll hit enter and oops there goes my API key from a previous clipboard. So secret redaction was a top priority and that was accomplished using presidio alongside litellm.

The providers are OpenAI, cerebras and my local AI. The thought behind this was that I could possibly utilizing the strengths of all three in order to get better performance and something I was more comfortable running in development.

  • OpenAI frontier models are generally good and they can be utilized with other models in opencode.
  • Cerebras has incredibly fast inference possibly good for programming and file search.
  • Local AI has the best privacy.

So possibly automating when each AI is used for also on the block.

I wanted to see as well whether I can observe what sort of commands the AI is running the most using grafana but that hasn’t been implemented as of this moment.

AI Summary of the Project

AI Infrastructure is a personal homelab project for bringing AI requests through a shared gateway, with planned controls for sensitive data, provider selection and observability. I am building it to make AI interactions easier to inspect and to reduce accidental disclosure of personally identifiable information (PII).

LiteLLM and promptfoo are deployed. The redaction, telemetry and hybrid provider integrations are still being built.

Deployed: LiteLLM, promptfoo · Planned integrations: Presidio, OpenTelemetry, Grafana observability stack, OpenAI, Cerebras and local AI

Problem and scope

Using AI tools across my system made it difficult to see what requests were being sent and how they were handled. I also wanted a way to intercept personal information accidentally included in prompts before it reached an external provider.

The project brings those concerns into a shared architecture: applications send model requests through LiteLLM, sensitive content is intended to pass through a redaction layer, and telemetry provides visibility into the request path. A separate CI/CD workflow is planned for code scanning and AI application and agent testing.

This is a homelab implementation in progress. The broader architecture combines local infrastructure with external model services.

Architecture

The intended design separates request handling, telemetry and security testing:

ComponentIntended responsibilityCurrent state
LiteLLMShared gateway for requests from applications and coding tools such as OpenCodeDeployed; wider integrations in progress
PresidioDetect and redact PII through the gateway before external model callsPlanned
OpenAI, Cerebras and local AIServe different workloads according to capability, latency and privacy requirementsRouting integration planned
OpenTelemetry and Grafana observability stackExport telemetry, store metrics in Prometheus and logs in Loki, and visualise them in GrafanaPlanned
promptfooEvaluate and red-team AI applications and agents through an automated testing workflowDeployed; CI/CD testing integration in progress

In the planned request path, applications call LiteLLM, the redaction integration processes sensitive content, and the gateway forwards the request to the selected provider. Telemetry follows a separate path into the observability services. The testing workflow exercises configured targets and evaluates their responses.

Design decisions and implementation challenges

My provider choices reflect different workload priorities. I plan to use OpenAI for tasks requiring frontier model capabilities, Cerebras for file-oriented tasks where inference speed matters, and local AI for queries I want to keep within my own infrastructure. The tradeoff is balancing model capability, response time and data location.

During promptfoo deployment, I encountered documentation that referenced an unavailable Docker package for its CI/CD functionality. I raised an upstream issue and found a workaround to continue the setup. That experience highlighted the need to check deployment instructions against available packages.

Current outcomes and next steps

The current milestone is deployment of LiteLLM and promptfoo. It establishes the gateway and testing tools as the starting point for the wider architecture.

Next steps are to integrate Presidio, connect the telemetry services, implement provider routing and complete automated testing in CI/CD. Validation will need to establish that sensitive content is handled as intended before external calls and that the observability path provides useful visibility without exposing the information the redaction layer is intended to protect.

What I learned

The project is developing my understanding of hybrid AI infrastructure: combining local and external inference with a shared gateway, privacy controls, observability and automated testing. The promptfoo deployment issue also provided practical experience reporting an upstream documentation problem and finding an alternative deployment approach.