TrueFoundry provides an enterprise-ready AI Gateway that can be used for governance and observability for agentic frameworks like CrewAI. TrueFoundry AI Gateway serves as a unified interface for LLM access, providing:
Unified API Access: Connect to 250+ LLMs (OpenAI, Claude, Gemini, Groq, Mistral) through one API
Low Latency: Sub-3ms internal latency with intelligent routing and load balancing
Enterprise Security: SOC 2, HIPAA, GDPR compliance with RBAC and audit logging
Quota and cost management: Token-based quotas, rate limiting, and comprehensive usage tracking
Observability: Full request/response logging, metrics, and traces with customizable retention
from crewai import LLM# Create an LLM instance with TrueFoundry AI Gatewaytruefoundry_llm = LLM( model="openai-main/gpt-4o", # Similarly you can call any model from any model provider base_url="https://your-truefoundry-endpoint/api/inference/v1", api_key="your_truefoundry_pat_token")# Use in your CrewAI agentsfrom crewai import Agent@agentdef researcher(self) -> Agent: return Agent( config=self.agents_config['researcher'], llm=truefoundry_llm, verbose=True )
Monitor your CrewAI agents through TrueFoundry’s metrics tab:
With Truefoundry’s AI gateway, you can monitor and analyze:
Performance Metrics: Track key latency metrics like Request Latency, Time to First Token (TTFS), and Inter-Token Latency (ITL) with P99, P90, and P50 percentiles
Cost and Token Usage: Gain visibility into your application’s costs with detailed breakdowns of input/output tokens and the associated expenses for each model
Usage Patterns: Understand how your application is being used with detailed analytics on user activity, model distribution, and team-based usage
Rate limit and Load balancing: You can set up rate limiting, load balancing and fallback for your models