This is JS/TS SDK for enabling Maxim observability. Maxim is an enterprise grade evaluation and observability platform.
npm install @maximai/maxim-js
const maxim = new Maxim({ apiKey: "maxim-api-key" });
const logger = await maxim.logger({ id: "log-repository-id" });
// Start a trace
logger.trace({ id: "trace-id" });
// Add a span
logger.traceSpan("trace-id", { id: "span-id", name: "Intent detection service" });
// Add llm call to this span
const generationId = uuid();
logger.spanGeneration("span-id", {
id: generationId,
name: "test-inference",
model: "gpt-3.5-turbo-16k",
messages: [
{
role: "user",
content: "Hello, how are you?",
},
],
modelParameters: {
temperature: 3,
},
provider: "openai",
});
// Make the actual call to the LLM
const result = llm_call();
// Log back the result
logger.generationResult(generationId, result);
// Ending span
logger.spanEnd("span-id");
// Ending trace
logger.traceEnd("trace-id");
Use our Maxim Langchain Tracer to integrate Maxim observability with just 2 lines of code.
- Feat: Adds
trace.addToSession
method for attaching trace to a new session
- Fix: minor bug fixes around queuing of logs.
- Fix: updates create test run api to use v2 api
- Fix: Handles marking test run as failed if the test run throws at any point after creating it on the platform.
- Feat: Adds support for
contextToEvaluate
inwithPromptVersionId
andwithWorkflowId
(by passing it as the second parameter) to be able to choose whichever variable or dataset column to use as context to evaluate, as opposed to only having the dataset column as context through theCONTEXT_TO_EVALUATE
datastructure mapping.
- Feat: Adds
createCustomEvaluator
andcreateCustomCombinedEvaluatorsFor
for adding custom evaluators to add them to the test runs. - Feat: Adds
withCustomLogger
to the test run builder chain to have a custom logger that follows theTestRunLogger
interface. - Feat: Adds
createDataStructure
function to create a data struture outside the test run builder. This is done to help use the data structure to infer types outside the test run builder. - Feat: Adds
withWorkflowId
andwithPromptVersionId
to the test run builder chain.
- Fix: makes
eventId
mandatory while logging an event. - Feat: adds
addMetadata
method to all log components for tracking any additional metadata. - Feat: adds
evaluate
method toTrace
,Span
,Generation
andRetrieval
classes for agentic (or node level) evaluation.
- Feat: Adds support for tool_calls as a separate entity.
- Change: Adds a new config parameter
raiseExceptions
to control exceptions thrown by the SDK. Default value isfalse
. -
getPrompt(s)
,getPromptChain(s)
andgetFolder(s)
could return undefined ifraiseExceptions
isfalse
.
- Change: Prompt management needs to be enabled via config.
- Chore: On multiple initializations of the SDK, SDK will warn the user. This start throwing exceptions in future releases.
- Chore: removed optional dependencies
- Feat: Adds a new
logger.flush
method to explicitly flushing logs
- Fix: fixes logger cleanup
- Feat: Jinja 2.0 variables support
- Fix: fixes incorrect message format for openai structured output params
- Fix: fixes incorrect mapping of messages for old langchain sdk
- Fix: config fixes for static classes
- Improvement: Adds AWS lambda support for Maxim SDK.
- Fix: There was a critical bug in the implementation of HTTP POST calls where some of the payloads were getting truncated.
- Fix: For ending any entity, we make sure endTimestamp is captured from client side. This was not the case earlier in some scenarios.
- Fix: Data payload will always be a valid JSON
- Improvement: Adds exponential retries to the API calls to Maxim server.
- Improvement: Readme updates.
- Improvement: Detailed logs in debug mode
- Adds scaffold to support LangchainTracer for Maxim SDK.
- Exposes MaximLogger for writing wrappers for different developer SDKs.
- Adds more type-safety for generation messages
- Adds support input/output for traces
- Adds support for node 12+
- Fixed a critical bug related to pushing generation results to the Maxim platform
- Improved error handling for network connectivity issues
- Enhanced performance when logging large volumes of data
- Adds retrieval updates
- Adds ChatMessage support
- Adds prompt chain support
- Adds vision model support for prompts
- Adds separate error reporting method for generations
- Adds top level methods for easier SDK integration
- Fixes logs push error
- Minor bug fixes
- Updates default base url
- Prompt selection algorithm v2
- Minor bug fixes
- Moves to new base URL
- Adds all new logging support
- Adds support for adding dataset entries via SDK.
- Folders, Tags and advanced filtering support.
- Add support for customizing default matching algorithm.
- Adds realtim sync for prompt deployment.
- Adds support for deployment variables and custom fields. [Breaking change from earlier versions.]
- Adds support for new SDK apis.
- Adds support for custom fields for Prompts.