Skip to main content
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
I