Get started
Install the SDK
Install syntropylabs-evalkit for Python or TypeScript, call init() once with your environment key, add your framework's middleware and send a first trace.
The EvalKit SDK runs inside your application and sends its traces to the Environment whose key you pass to init(). This page covers Python and TypeScript.
The in-app quickstart shows the same snippets with your real key filled in. Open it from the Install SDK step on Home, or with Install guide on the Environments tab. It has a tab for each SDK (Python, TypeScript, Go and Java), one for coding agents, and a Framework switch. The Go and Java tabs show manual-instrumentation snippets.
1. Install
pip install syntropylabs-evalkit # installs as syntropylabs-evalkit, imported as evalkit2. Initialize once, as early as possible
Call init() once at startup, before the modules that make requests are loaded, so auto-instrumentation can hook the libraries. The only required option is the environment key. service_name is the name the Services view and the trace list show. environment should match the kind of the Environment the key belongs to.
import evalkit
evalkit.init(
subscription_key="tk_live_...", # the environment key
service_name="my-service",
environment="development", # development | staging | production
)
# Every OpenAI / Anthropic / HTTP / DB call from here on is traced automatically.
from openai import OpenAI
resp = OpenAI().chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
evalkit.flush() # before a short-lived process exits3. Add the middleware for your framework
With the middleware, each incoming request becomes one root trace and every model, tool, HTTP and database call inside it nests underneath. Without it, calls are still traced, each as its own trace.
# FastAPI / Starlette
from evalkit import EvalKitMiddleware
app.add_middleware(EvalKitMiddleware)
# Flask
evalkit.instrument_flask(app)
# Django: add to MIDDLEWARE
"evalkit.EvalKitDjangoMiddleware"4. Make one request
Run your app and send it one request. The quickstart checks the Environment for a trace every 5 seconds for the first two minutes, then every 15 seconds. After 30 minutes with no trace it stops and offers Check again.
When the trace arrives, the page shows "First trace received" with the operation, latency, span count and model, and a View trace button. Continue in Your first trace.
Home's checklist marks Install SDK and Receive first trace as done on its next load. It reads them from the Environment's traces of the last month, not from a stored flag, so a project instrumented entirely from a terminal is already checked off.
If no trace arrives
After two minutes with no trace, the quickstart lists the usual causes:
- A
401from the ingest endpoint means the key in your config does not match this Environment. Copy it again from the Environments tab. - The process must be able to reach
api.syntropylabs.ai. Check egress rules and proxies. - A short script can exit before the batch is sent. Call
flush()at the end, or keep the process alive. - Traces arrive in the Environment whose key you used. If you are looking at another one, switch it in the top bar.
If a check itself fails, the quickstart stops and shows "Could not check for traces" with Retry.
What is traced automatically
| Category | Python | TypeScript |
|---|---|---|
| LLM clients | OpenAI, Anthropic, Bedrock (boto3 and aiobotocore), Cohere, Google GenAI and Vertex, Mistral | OpenAI, Anthropic, Bedrock, Cohere, Google, Vertex, LangChain |
| Frameworks | LangChain and LangGraph, LiteLLM, Claude Agent SDK | None |
| HTTP | requests, httpx and aiohttp, with method, URL, status and latency | fetch, axios and node:http, with method, URL, status and latency |
| Databases | SQLAlchemy, psycopg, asyncpg, PyMongo and Redis, with query text and latency | Postgres, MySQL, MongoDB and Redis, with query text and latency |
| Your own code | Functions in your app's source tree, on by default | Opt in per function, tool or class, or for the whole app on NestJS |
Next, add session_id, user_id and device_id so traces group into conversations and users. See Sessions and users. The full option list, content capture and masking are in Configuration and privacy.