@obyflow/llm-core
v1.1.2
Published
Shared `LLMAdapter` interface and provider-agnostic helpers for [Obyflow](https://github.com/Obyflow/obyflow)'s AI-assisted investigation features — implemented by [`@obyflow/llm-anthropic`](https://www.npmjs.com/package/@obyflow/llm-anthropic), [`@obyflo
Readme
@obyflow/llm-core
Shared LLMAdapter interface and provider-agnostic helpers for Obyflow's AI-assisted investigation features — implemented by @obyflow/llm-anthropic, @obyflow/llm-openai, @obyflow/llm-gemini, and @obyflow/llm-ollama, and consumed internally by the obyflow CLI's investigate/ask commands.
Install it directly only if you're implementing a custom LLMAdapter for a provider Obyflow doesn't ship.
Install
npm install @obyflow/llm-coreRequires Node.js ≥ 22.
What's included
LLMAdapterinterface — the contract every provider adapter implements- Token usage & cost tracking —
estimateTokenCount,getContextLimit,estimateCostUsdwith built-in pricing tables (Claude, GPT-4o/5, Gemini) - Resilient calls —
withRetry/isRetryableLLMError, automatic retry with exponential backoff on 429/503/network errors - Grounding validation —
validateEvidenceGrounding, flags LLM citations that don't match real evidence - Context trimming —
trimEvidenceForContext, token-budget-aware evidence trimming
Links
License
MIT © Anupam Kumar
