Skip to content

Commit

Permalink
Add notes on Langchain logging challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveParr committed Feb 28, 2024
1 parent 322a0cb commit d3c0bdd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions starpilot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def astrologer(
if not os.path.exists(VECTORSTORE_PATH):
raise Exception("Please load the stars before shooting")

OPENAI_API_KEY = os.environ["OPENAI_API_KEY"] # noqa: F841 rely on langchain to handle this
OPENAI_ORG_ID = os.environ["OPENAI_ORG_ID"] # noqa: F841 rely on langchain to handle this
OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]
OPENAI_ORG_ID = os.environ["OPENAI_ORG_ID"]

metadata_field_info = [
# IDEA: create valid specific values on data load for each users content
Expand Down
12 changes: 12 additions & 0 deletions starpilot/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,15 @@ which is reported to pylance as:

but actually is runnable and correct?


## Langchain has bad local logging becuase it wants you to use langsmith

Langchain the company seemed like they just weren't interested in local logging. `verbose=true` seems to not actually do anything in many cases, and grabbing information out of chains during runtime either gives lots of pointless model card information which is not useful, or forces a process of function wrapping or avoiding LCEL.

Instead they've been developing an extremely complex cloud observability tool called Langsmith. It is defintely useful, and easy to set up and currently has a generous free personal tier. However it does seem a little disingeous to not have a local logging solution, even if the 'new paradigm' of LLM/AI does pose some challenges to traditional logging.

These challenges seem to be:

logging run detail and then aggregating across a number of runs and parameters is more valuable than logging the detail of a single run
langchain is effectively a data orchestration tool, so the path of a run can vary significantly even with no code changes
llm/ai is inherently non-deterministic, so the same code can produce different results

0 comments on commit d3c0bdd

Please sign in to comment.