{"slug": "i-published-pip-install-ajah-sdk-and-npm-install-ajah-sdk-here-s-what-they-do", "title": "I published pip install ajah-sdk and npm install ajah-sdk — here's what they do", "summary": "A developer released Python and Node.js SDKs for Ajah, an open-source self-hosted LLM observability gateway. The SDKs simplify integration by replacing manual header injection with a single import, enabling features like hallucination scoring, cost attribution, and PII masking. Ajah runs locally via Docker, ensuring data privacy under an MIT license.", "body_md": "After two weeks of building Ajah — an\n\nopen-source self-hosted LLM observability\n\ngateway — today I hit a milestone that\n\nactually matters for developer adoption.\n\npip install ajah-sdk\n\nnpm install ajah-sdk\n\nBoth are live. Both work. Here's what\n\nthey do and why I built them.\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nTHE PROBLEM THEY SOLVE\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nAjah is a gateway proxy that sits between\n\nyour app and any LLM provider. It scores\n\nevery response for hallucination risk,\n\nverifies RAG outputs, detects narrative\n\ndrift across sessions, attributes costs\n\nper feature, and masks PII before storage.\n\nBefore the SDKs, using Ajah required:\n\nNow it's one import.\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nPYTHON SDK\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\npip install ajah-sdk\n\nfrom ajah import AjahClient\n\nclient = AjahClient(\n\ngateway_url=\"[http://localhost:8080](http://localhost:8080)\",\n\napi_key=\"your-groq-key\",\n\nfeature_name=\"my-app\",\n\nuser_id=\"user-123\",\n\n)\n\nresponse = client.chat(\n\nmodel=\"llama-3.3-70b-versatile\",\n\nmessages=[{\"role\": \"user\",\n\n\"content\": \"Hello\"}],\n\n)\n\nEvery call through the SDK automatically\n\ninjects the Ajah observability headers:\n\nX-Feature-Name, X-User-ID, X-Session-ID,\n\nX-Agent-Step\n\nThese headers drive the entire Ajah\n\npipeline — cost attribution, quality\n\nscoring, PII detection, session tracing.\n\nSession tracking for multi-turn agents:\n\nwith client.session() as session:\n\nplan = session.chat(\n\nmodel=\"llama-3.3-70b-versatile\",\n\nmessages=[{\"role\": \"user\",\n\n\"content\": \"Plan research\"}],\n\nstep_name=\"step-1-planner\",\n\n)\n\nresearch = session.chat(\n\nmodel=\"llama-3.3-70b-versatile\",\n\nmessages=[{\"role\": \"user\",\n\n\"content\": \"Execute plan\"}],\n\nstep_name=\"step-2-researcher\",\n\n)\n\nprint(f\"View session: {session.dashboard_url}\")\n\nAjahSession automatically increments step\n\nnumbers, maintains the session ID across\n\nturns, and gives you a direct URL to the\n\nvisual step tree in the Ajah dashboard.\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nNODE.JS SDK (TYPESCRIPT)\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nnpm install ajah-sdk\n\nimport { AjahClient } from 'ajah-sdk'\n\nconst client = new AjahClient({\n\ngatewayUrl: '[http://localhost:8080](http://localhost:8080)',\n\napiKey: process.env.GROQ_API_KEY!,\n\nfeatureName: 'my-app',\n\nuserId: 'user-123',\n\n})\n\nconst response = await client.chat({\n\nmodel: 'llama-3.3-70b-versatile',\n\nmessages: [{ role: 'user',\n\ncontent: 'Hello' }],\n\n})\n\nFull TypeScript types included.\n\nAjahSession works the same way:\n\nconst session = client.session()\n\nconst r1 = await session.chat({\n\nmodel: 'llama-3.3-70b-versatile',\n\nmessages: [...],\n\nstepName: 'step-1-planner',\n\n})\n\nconsole.log(session.dashboardUrl)\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nWHAT RUNS BEHIND THE SDK\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nEvery call through the SDK goes through\n\nthe Ajah gateway which runs:\n\nHallucination scoring — sentence\n\ntransformers evaluate every response\n\nfor factual grounding. Async. Zero\n\nlatency added.\n\nClaim density detection — flags responses\n\nthat make many specific claims on\n\nlow-context prompts.\n\nLinguistic hedge detection — flags\n\noverconfident responses on complex\n\nmedical, legal, or financial questions.\n\nNarrative drift detection — compares\n\nclaims across session turns. Flags\n\nwhen a model reverses position.\n\nCost attribution — USD cost per call,\n\ntracked by feature and model.\n\nPII masking — emails, phones, SSNs,\n\ncredit cards masked before storage.\n\nRAG verification — if you pass source\n\ndocuments, responses are verified\n\nagainst them. Contradictions flagged.\n\nPrometheus metrics — all signals exposed\n\nat /metrics for Grafana integration.\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nSELF-HOSTED\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nThe SDK points at your own running Ajah\n\ninstance. No data goes through my servers.\n\ngit clone [https://github.com/VigneshReddy-afk/ajah](https://github.com/VigneshReddy-afk/ajah)\n\ncd ajah\n\ndocker-compose up -d\n\nThen use the SDK pointing at localhost:8080.\n\nMIT license. Free forever.\n\n→ pip install ajah-sdk\n\n→ npm install ajah-sdk\n\n→ github.com/VigneshReddy-afk/ajah\n\n→ useajah.com", "url": "https://wpnews.pro/news/i-published-pip-install-ajah-sdk-and-npm-install-ajah-sdk-here-s-what-they-do", "canonical_source": "https://dev.to/vignesh_reddy_53e403f62d2/i-published-pip-install-ajah-sdk-and-npm-install-ajah-sdk-heres-what-they-do-3m9h", "published_at": "2026-06-18 18:14:54+00:00", "updated_at": "2026-06-18 18:30:12.742848+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-safety", "mlops"], "entities": ["Ajah", "Groq", "GitHub", "Docker", "Prometheus", "Grafana", "VigneshReddy-afk"], "alternates": {"html": "https://wpnews.pro/news/i-published-pip-install-ajah-sdk-and-npm-install-ajah-sdk-here-s-what-they-do", "markdown": "https://wpnews.pro/news/i-published-pip-install-ajah-sdk-and-npm-install-ajah-sdk-here-s-what-they-do.md", "text": "https://wpnews.pro/news/i-published-pip-install-ajah-sdk-and-npm-install-ajah-sdk-here-s-what-they-do.txt", "jsonld": "https://wpnews.pro/news/i-published-pip-install-ajah-sdk-and-npm-install-ajah-sdk-here-s-what-they-do.jsonld"}}