โ† Open Source

๐Ÿ Sublingual helps you log and analyze all of your LLM calls, including the prompt template, call parameters, responses, tool calls, and more. The coolest thing. You don't have to change any of your code.

InfrastructureObservabilityTypeScript
Momentum
+0stars in 24 hours0.0%
52
Stars
4
Forks
+0
This week
0
Contributors
Created 2025-02-21 ยท Updated 2025-07-26 ยท #26788 today
README

๐Ÿ ๐Ÿ” Sublingual

๐Ÿ˜ด Observe you LLM outputs and do evals without changing your code ๐Ÿ˜ด

Ask us any questions, suggest features, or see what everyone is building on our Discord!

Get started instantly

  1. Install:

    pip install subl
  2. Throw subl in front of your original command

    subl python your_script.py      # Replace 'python your_script.py' with your actual entry point
  3. Pull up the dashboard:

    subl server

โ˜๏ธ logs will be written to ./.sublingual/logs under the same directory you launch subl ... in, so be sure to run subl server in the same directory or pass --project-dir flag

๐Ÿค” What is Sublingual?

Sublingual helps you log and analyze all of your LLM calls, including the prompt template, call parameters, responses, tool calls, and more. The coolest thing? You don't have to change any of your code!

๐Ÿ“ All your data stays local

โœ‚๏ธ Disentangled logic: The reliability of your LLM calls are not dependent on the logging server

๐Ÿ”— Easy integration: No code changes necessary

๐Ÿช„ How does it work?

We automatically patch the OpenAI/Anthropic client to log all LLM calls and responses, then analyze the runtime code to extract the prompt template that you used as well. All of this so you don't have to change any of your code. When you don't want to log, you can just run your script as usual without subl, and the patch will not be applied or affect your code at all.

Adding subl before a command will trigger all python subprocesses spawned by this command to, on initialization, patch the LLM client classes to log calls and scan the runtime stack frames for info. By doing so, it can automatically (try to) find prompt templates and track server sessions.

Supported LLM Providers and Frameworks

โœ… OpenAI Client (Async + Sync)

โœ… Anthropic Client (Async + Sync)

โณ LangChain calls to ChatOpenAI or ChatAnthropic are logged, but we're working on full LangChain support to trace the entire workflow!

โš ๏ธ Other LLM clients will not be logged, but hot-swapped urls are supported. e.g. Gemini

client = OpenAI(
   api_key="GEMINI_API_KEY",
   base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
)

โš ๏ธ Streaming responses are not currently supported for logging

Running Evals

โš–๏ธ We currently offer LLM as judge evals using OpenAI models. We have prebuilt Correctness, System Prompt Obedeience, and User response sentiment metrics that you can use, but we also offer a way for you to define your own judging criteria inside the dashboard.

โ— You must provide your own api key if you want to use this feature, and can do so by setting the OPENAI_API_KEY environment variable, or just placing it in a .env in the same directory that you run subl server in.

Server support

If you are running a server that makes LLM calls, we support Flask, FastAPI, Django, and more. Just throw subl before it like

subl flask run ...

License

MIT License - see the LICENSE file for details.

Telemetry

We collect very basic telemetry to understand how the product is being used. Currently we only collect how many people are downloading and running the package. You can opt out by setting the NO_TELEMETRY environment variable to 1.

Nearby in the ranking
Similar items

AI Rank for iPhone

Follow AI model rankings

Download on the App Store