Lytix supports capturing custom LLM traces (e.g. not associated with any SDK or API call). This is useful if you have custom models you’d still like to track.
from lytix_py import lytix@lytix.trace(modelName="nodeCli")async def getResponse(logger): modelOutput = "Paris is the capital of France" # Set our defined params however we want lytix.setMessage("Some user input", "user") lytix.setMessage(modelOutput, "assistant") # Optional values lytix.setUserIdentifier("testUser") lytix.setSessionId("testSession") return modelOutput
import { MetricCollector } from "@lytix/node-cli";const response = await MetricCollector.captureModelTrace({ modelName: "testModelName", systemPrompt: "You are a helpful assistant", userPrompt: "Some user input", generateModelOutput: async () => { const openai = new OpenAI(); ... /** * This callback is expecting the model output to be returned */ return response; }});
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Lytix","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"favicon":"/logo/lytix-logo.svg","logo":{"light":"https://mintlify.s3-us-west-1.amazonaws.com/lytix/logo/lytix-logo.svg","dark":"https://mintlify.s3-us-west-1.amazonaws.com/lytix/logo/lytix-logo.svg"},"api":{"openapi":["api-reference/openapi.yml"]},"navbar":{"links":[{"label":"Support","href":"mailto:support@lytix.co"}],"primary":null},"footer":{"socials":{"github":"https://github.com/Lytix-Labs"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lytix","hasAudioNarration":false,"actualSubdomain":"lytix","customDomains":["docs.lytix.co"],"gitSource":{"type":"github","owner":"sidpremkumar","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e63294a5dc2e6daf36ec","collectionId":"0baa2ad3-fb7b-46f6-b0f8-88652c19cd6f","schemaVersion":"v2"},"entitlements":{},"buildId":"6ae91ffd380856db5583d4b1:success","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"Documentation","count":39},{"language":"default","tag":"API Keys","count":4},{"language":"default","tag":"Alerts","count":4},{"language":"default","tag":"Proxy","count":4},{"language":"default","tag":"API Reference","count":4},{"language":"default","tag":"Async Logging","count":2},{"language":"default","tag":"Caching","count":2},{"language":"default","tag":"Custom Errors","count":2},{"language":"default","tag":"Custom LLM Tracing","count":2},{"language":"default","tag":"Guardrails","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"CustomLLMTracing/custom-llm-tracing","slug":"/CustomLLMTracing/custom-llm-tracing","pageMetadata":{"title":"Custom LLM Tracing","description":"Learn what it means to capture custom LLM traces","href":"/CustomLLMTracing/custom-llm-tracing"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn what it means to capture custom LLM traces\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Lytix supports capturing custom LLM traces (e.g. not associated with any SDK or API call). This is useful if you have custom models you’d still like to track.`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lytix_py `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lytix`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@lytix.trace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`modelName`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"nodeCli\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getResponse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`logger`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` modelOutput `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Paris is the capital of France\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Set our defined params however we want`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lytix.setMessage(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Some user input\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lytix.setMessage(modelOutput, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Optional values`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lytix.setUserIdentifier(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"testUser\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` lytix.setSessionId(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"testSession\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` modelOutput`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Typescript`,numberOfLines:`15`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MetricCollector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@lytix/node-cli\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` MetricCollector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`captureModelTrace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` modelName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"testModelName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` systemPrompt:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a helpful assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` userPrompt:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Some user input\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` generateModelOutput`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` openai`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /**`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` * This callback is expecting the model output to be returned`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` */`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Custom LLM Tracing","description":"Learn what it means to capture custom LLM traces","href":"/CustomLLMTracing/custom-llm-tracing"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"lytix","siteName":"Lytix","title":"Custom LLM Tracing - Lytix","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"CustomLLMTracing/custom-llm-tracing.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn what it means to capture custom LLM traces\">\u003cmeta data-mint-head name=\"application-name\" content=\"Lytix\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lytix/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lytix/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lytix/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lytix/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Custom LLM Tracing - Lytix\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn what it means to capture custom LLM traces\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Lytix\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lytix.mintlify.site/_mintlify/api/og/v2?division=Custom+LLM+Tracing\u0026amp;title=Custom+LLM+Tracing\u0026amp;description=Learn+what+it+means+to+capture+custom+LLM+traces\u0026amp;theme=950fe68f562f23c275cf1e6d\u0026amp;signature=945bbfd91127e0e883d7ec492ea69da4e27f5aa1d6573e9cc4ff9387b54df3a6\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Custom LLM Tracing - Lytix\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn what it means to capture custom LLM traces\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lytix.mintlify.site/_mintlify/api/og/v2?division=Custom+LLM+Tracing\u0026amp;title=Custom+LLM+Tracing\u0026amp;description=Learn+what+it+means+to+capture+custom+LLM+traces\u0026amp;theme=950fe68f562f23c275cf1e6d\u0026amp;signature=945bbfd91127e0e883d7ec492ea69da4e27f5aa1d6573e9cc4ff9387b54df3a6\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/lytix/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Lytix\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/CustomLLMTracing/custom-llm-tracing.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.lytix.co/#organization\",\"name\":\"Lytix\",\"url\":\"https://docs.lytix.co\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintlify.s3-us-west-1.amazonaws.com/lytix/logo/lytix-logo.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.lytix.co#website\",\"name\":\"Lytix\",\"url\":\"https://docs.lytix.co\",\"publisher\":{\"@id\":\"https://docs.lytix.co/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing#webpage\",\"url\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing\",\"name\":\"Custom LLM Tracing\",\"description\":\"Learn what it means to capture custom LLM traces\",\"isPartOf\":{\"@id\":\"https://docs.lytix.co#website\"},\"breadcrumb\":{\"@id\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lytix\",\"item\":\"https://docs.lytix.co\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Custom LLM Tracing\",\"item\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing#article\",\"headline\":\"Custom LLM Tracing\",\"name\":\"Custom LLM Tracing\",\"description\":\"Learn what it means to capture custom LLM traces\",\"url\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing\",\"mainEntityOfPage\":{\"@id\":\"https://docs.lytix.co/CustomLLMTracing/custom-llm-tracing#webpage\"},\"publisher\":{\"@id\":\"https://docs.lytix.co/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.lytix.co#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Lytix\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Lytix","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":"/introduction"}]},{"group":"API Keys","pages":[{"title":"Key Setup","href":"/APIKeys/api-key-setup"},{"title":"Setting API Key In Code","href":"/APIKeys/set-api-key-in-code"},{"title":"Environment Variable Setup","href":"/APIKeys/env-var-setup"},{"title":"Keys \u0026 Workflows","href":"/APIKeys/api-keys-and-workflows"}]},{"group":"Proxy","pages":[{"title":"OpenAI Integration","href":"/Quickstart/openai-integration"},{"title":"Vercel AI Integration","href":"/Quickstart/vercelai-integration"},{"title":"Gemini Integration","href":"/Quickstart/gemini-integration"},{"title":"Langchain Integration","href":"/Quickstart/langchain-integration"}]},{"group":"Image \u0026 Video","pages":[{"title":"Images","href":"/MultiModal/images"},{"title":"Video","href":"/MultiModal/video"}]},{"group":"Async Logging","pages":[{"title":"Quickstart","href":"/AsyncLogging/async-logging-setup"},{"title":"Manually Importing Events","href":"/Quickstart/manually-importing-events"}]},{"group":"Testing","pages":[{"title":"Agent as Judge","href":"/Testing/agent-as-judge"}]},{"group":"Users","pages":[{"title":"User Overview","href":"/Users/user-overview"},{"title":"Feedback","href":"/Users/feedback"}]},{"group":"Metadata","pages":[{"title":"Metadata","href":"/Metadata/metadata-setup"}]},{"group":"Workflows","pages":[{"title":"Workflow Setup","href":"/Workflows/workflows-setup"},{"title":"Custom Evaluations","href":"/Workflows/workflows-custom-evaluation"}]},{"group":"Datasets","pages":[{"title":"Datasets","href":"/Datasets/dataset-setup"}]},{"group":"Caching","pages":[{"title":"Caching Setup","href":"/Caching/caching-setup"},{"title":"Using Caching","href":"/Caching/using-caching"}]},{"group":"Playground","pages":[{"title":"Playground","href":"/Playground/playground"}]},{"group":"Alerts","pages":[{"title":"Alerts Overview","href":"/Alerts/overview"},{"title":"Alert Channels","href":"/Alerts/alert-channels"},{"title":"Custom Evaluation Alerts","href":"/Alerts/custom-evaluation-alerts"},{"title":"Custom Guardrail Alerts","href":"/Alerts/custom-guardrail-alerts"}]},{"group":"Bot Evaluation","pages":[{"title":"Session Evaluation Setup","href":"/SessionEvaluation/session-evaluation-setup"},{"title":"Push Session Data","href":"/SessionEvaluation/session-evaluation-push-sessions"}]},{"group":"Prompts","pages":[{"title":"Prompts","href":"/Prompts/prompts"}]},{"group":"Integrations","pages":[{"title":"Helicone","href":"/integrations/helicone"},{"title":"PostHog","href":"/integrations/posthog"}]},{"group":"Guardrails","pages":[{"title":"Guardrails","href":"/Guardrails/guardrails"},{"title":"Guardrails Setup","href":"/Guardrails/guardrails-setup"}]},{"group":"Custom Errors","pages":[{"title":"Custom Errors","href":"/CustomErrors/custom-errors"},{"title":"Custom Errors Setup","description":"How to setup custom errors in your project","href":"/CustomErrors/custom-errors-setup"}]},{"group":"Custom LLM Tracing","pages":[{"title":"Custom LLM Tracing","href":"/CustomLLMTracing/custom-llm-tracing"},{"title":"Custom LLM Tracing Setup","description":"How to setup custom LLM tracing in your project","href":"/CustomLLMTracing/custom-llm-tracing-setup"}]},{"group":"CLI","pages":[{"title":"CLI Login","href":"/CLI/cli-login"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Custom LLM Tracing - Lytix","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":[],"chunks":[]}