惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
G
Google Developers Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
有赞技术团队
有赞技术团队
Vercel News
Vercel News
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog RSS Feed
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
The Cloudflare Blog
B
Blog
C
Check Point Blog
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
U
Unit 42
D
Docker
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏
博客园 - Franky
A
About on SuperTechFans

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I published pip install ajah-sdk and npm install ajah-sdk...
Vignesh Reddy · 2026-06-19 · via DEV Community

Vignesh Reddy

After two weeks of building Ajah — an
open-source self-hosted LLM observability
gateway — today I hit a milestone that
actually matters for developer adoption.

pip install ajah-sdk
npm install ajah-sdk

Both are live. Both work. Here's what
they do and why I built them.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE PROBLEM THEY SOLVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Ajah is a gateway proxy that sits between
your app and any LLM provider. It scores
every response for hallucination risk,
verifies RAG outputs, detects narrative
drift across sessions, attributes costs
per feature, and masks PII before storage.

Before the SDKs, using Ajah required:

  • Cloning the repo
  • Configuring Docker
  • Manually setting headers on every request

Now it's one import.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PYTHON SDK
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

pip install ajah-sdk

from ajah import AjahClient

client = AjahClient(
gateway_url="http://localhost:8080",
api_key="your-groq-key",
feature_name="my-app",
user_id="user-123",
)

response = client.chat(
model="llama-3.3-70b-versatile",
messages=[{"role": "user",
"content": "Hello"}],
)

Every call through the SDK automatically
injects the Ajah observability headers:

X-Feature-Name, X-User-ID, X-Session-ID,
X-Agent-Step

These headers drive the entire Ajah
pipeline — cost attribution, quality
scoring, PII detection, session tracing.

Session tracking for multi-turn agents:

with client.session() as session:
plan = session.chat(
model="llama-3.3-70b-versatile",
messages=[{"role": "user",
"content": "Plan research"}],
step_name="step-1-planner",
)
research = session.chat(
model="llama-3.3-70b-versatile",
messages=[{"role": "user",
"content": "Execute plan"}],
step_name="step-2-researcher",
)
print(f"View session: {session.dashboard_url}")

AjahSession automatically increments step
numbers, maintains the session ID across
turns, and gives you a direct URL to the
visual step tree in the Ajah dashboard.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NODE.JS SDK (TYPESCRIPT)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

npm install ajah-sdk

import { AjahClient } from 'ajah-sdk'

const client = new AjahClient({
gatewayUrl: 'http://localhost:8080',
apiKey: process.env.GROQ_API_KEY!,
featureName: 'my-app',
userId: 'user-123',
})

const response = await client.chat({
model: 'llama-3.3-70b-versatile',
messages: [{ role: 'user',
content: 'Hello' }],
})

Full TypeScript types included.
AjahSession works the same way:

const session = client.session()

const r1 = await session.chat({
model: 'llama-3.3-70b-versatile',
messages: [...],
stepName: 'step-1-planner',
})

console.log(session.dashboardUrl)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT RUNS BEHIND THE SDK
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Every call through the SDK goes through
the Ajah gateway which runs:

Hallucination scoring — sentence
transformers evaluate every response
for factual grounding. Async. Zero
latency added.

Claim density detection — flags responses
that make many specific claims on
low-context prompts.

Linguistic hedge detection — flags
overconfident responses on complex
medical, legal, or financial questions.

Narrative drift detection — compares
claims across session turns. Flags
when a model reverses position.

Cost attribution — USD cost per call,
tracked by feature and model.

PII masking — emails, phones, SSNs,
credit cards masked before storage.

RAG verification — if you pass source
documents, responses are verified
against them. Contradictions flagged.

Prometheus metrics — all signals exposed
at /metrics for Grafana integration.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SELF-HOSTED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The SDK points at your own running Ajah
instance. No data goes through my servers.

git clone https://github.com/VigneshReddy-afk/ajah
cd ajah
docker-compose up -d

Then use the SDK pointing at localhost:8080.

MIT license. Free forever.

→ pip install ajah-sdk
→ npm install ajah-sdk

→ github.com/VigneshReddy-afk/ajah
→ useajah.com

python #nodejs #llm #opensource

buildinpublic #devtools #aiinfrastructure