# langsmith traceable with tracing off and local run trees

Recorded on 2026-11-14 on the x86 server guest with Ollama 0.31.1 on CPU. Models: qwen3:4b-instruct-2507-q4_K_M. ChatOllama settings: temperature 0, seed 42, num_ctx 16384, num_predict 512.

## tracing off: traceable is a plain call

{
  "tracing_is_enabled()": false,
  "result": {
    "answer": "value-for-alpha"
  }
}

get_current_run_tree() inside the call: None

## tracing_context(enabled='local'): run trees are built in memory

{
  "tracing_is_enabled()": "local"
}

{
  "name": "pipeline",
  "run_type": "chain",
  "id": "<uuid-1>",
  "trace_id": "<uuid-1>",
  "parent_run_id": null,
  "dotted_order": "<dotted-time><uuid-1>",
  "inputs": {
    "question": "look up beta"
  },
  "outputs": {
    "answer": "value-for-beta"
  },
  "tags": [
    "m101"
  ],
  "metadata": {
    "manual": "langchain-101",
    "ls_method": "traceable"
  },
  "error": null,
  "child_runs": [
    {
      "name": "lookup",
      "run_type": "tool",
      "id": "<uuid-2>",
      "trace_id": "<uuid-1>",
      "parent_run_id": "<uuid-1>",
      "dotted_order": "<dotted-time><uuid-1>.<dotted-time><uuid-2>",
      "inputs": {
        "key": "beta"
      },
      "outputs": {
        "output": "value-for-beta"
      },
      "tags": [
        "m101"
      ],
      "metadata": {
        "manual": "langchain-101",
        "ls_method": "traceable"
      },
      "error": null,
      "child_runs": []
    }
  ]
}

## an error inside a traced call

raised RuntimeError('tool broke')

{
  "name": "fails",
  "error": "RuntimeError('tool broke')"
}

HTTP requests the client received for the traceable runs:
{}

## a create_agent run inside a local trace: the LangChain runs are sent to the client

answer: 2 + 3 = 5.

HTTP requests the client received, by method and path:
{
  "PATCH /runs/<run-id>": 7,
  "POST /runs": 7
}

chain agent_turn
  chain LangGraph
    chain model
      llm ChatOllama
    chain tools
      tool add
    chain model
      llm ChatOllama

## tracing_context(enabled=False) with collect_runs: the LangChain runs stay in memory

answer: 2 + 3 = 5.

collect_runs().traced_runs:
[
  "llm ChatOllama",
  "tool add",
  "llm ChatOllama",
  "chain LangGraph"
]

HTTP requests the client received:
{}

langsmith 0.14.17

## evaluate(upload_results=False) on a plain function, three examples

warning LangSmithBetaWarning: 'upload_results' parameter is in beta.
warning DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead

stdout: Starting evaluation of experiment: %s <experiment-name>

rows:
[
  {
    "inputs": {
      "a": 2,
      "b": 3
    },
    "outputs": {
      "sum": 5
    },
    "reference": {
      "sum": 5
    },
    "scores": {
      "exact": true
    }
  },
  {
    "inputs": {
      "a": 4,
      "b": 4
    },
    "outputs": {
      "sum": 9
    },
    "reference": {
      "sum": 8
    },
    "scores": {
      "exact": false
    }
  },
  {
    "inputs": {
      "a": 1,
      "b": 1
    },
    "outputs": {
      "sum": 2
    },
    "reference": {
      "sum": 2
    },
    "scores": {
      "exact": true
    }
  }
]

summary evaluators:
{
  "accuracy": 0.6666666666666666
}

HTTP requests the client received:
{}

## evaluate(upload_results=False) on a create_agent target: the LangChain runs are sent

warning DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead

stdout: Starting evaluation of experiment: %s <experiment-name>

rows:
[
  {
    "inputs": {
      "question": "What is 2 + 3?"
    },
    "outputs": {
      "answer": "2 + 3 = 5."
    },
    "reference": {
      "answer": "The sum is 5."
    },
    "scores": {
      "same_answer": false
    }
  }
]

HTTP requests the client received:
{
  "PATCH /runs/<run-id>": 7,
  "POST /runs": 7
}

## evaluate(upload_results=False) with the agent inside tracing_context(enabled=False)

warning DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead

stdout: Starting evaluation of experiment: %s <experiment-name>

rows:
[
  {
    "inputs": {
      "question": "What is 2 + 3?"
    },
    "outputs": {
      "answer": "2 + 3 = 5."
    },
    "reference": {
      "answer": "The sum is 5."
    },
    "scores": {
      "same_answer": false
    }
  }
]

HTTP requests the client received:
{}

warning DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
