Docs
CommunityJev Repos & SDKs
TypeSafe Python SDK: Advanced Usage
Documentation for performance tuning, logging, and forward compatibility in the TypeSafe Python SDK, covering client reuse, zstd compression, HTTP/2, connection limits, and extra_body request fields.
- Format
- Docs
- Reading time
- 2 min
- Published by
- Community
- Added
- Nov 23, 2026
Highlights
- Recommends reusing a client instance across requests to avoid new connections and TLS handshakes.
- Clients compress request bodies of 1 KiB or more with zstd; install typesafe-sdk[zstd] on Python earlier than 3.14.
- Default clients open at most 100 connections and keep them open for 30 seconds while idle.
- Logging goes to the typesafe_sdk logger; TYPESAFE_LOG_LEVEL accepts debug, info, warning, error, or off.
- Secret headers such as authorization, API keys, and cookies are redacted from log output, but bodies are not.
Questions about this entry
Short answers drawn from the linked project or page.
Set the typesafe_sdk logger level, for example logging.getLogger("typesafe_sdk").setLevel(logging.DEBUG), or set TYPESAFE_LOG_LEVEL to debug, info, warning, error, or off before importing the SDK. Info logs one summary line per request; debug also logs request and response headers and bodies.
The default clients open at most 100 connections and keep all of them open for 30 seconds while idle, so bursts reuse connections instead of opening new ones. When supplying your own http_client, set appropriate limits yourself.
Clients use HTTP/1.1 by default, which scales concurrency with connections at the cost of a TLS handshake for each new one. Keep the default for high request rates; use HTTP/2 for low to moderate concurrency when you want fewer connections, such as behind a proxy or firewall.
Pass them through extra_body on the system_one call, or send raw question dictionaries instead of typed objects. The page notes that unknown fields are a forward-compatibility escape hatch, and only fields supported by the API should be sent.
Clients compress request bodies of 1 KiB or more with zstd to reduce upload size and time, especially for large states. Install it with uv add "typesafe-sdk[zstd]" on Python versions earlier than 3.14; compression can also be configured or disabled via the client constructor argument.
No. Secret headers, including authorization, API keys, cookies, and any header whose name contains token or secret, are redacted from log output, but request and response bodies are not redacted.
TypeSafeClient can be shared between threads, but under heavy load its connection pool becomes the bottleneck. Create one client per thread and reuse it for every request that thread sends, for example with a threading.local subclass holding the client.
Reactions & coverage
Posts, threads, and videos about this entry from around the web.
Hacker News: Simon Willison's overview of Noul, Choice, and Score, and where a decision model fits.
benwerd53 pointsJev introduces a new shape of LLMRead the thread on Hacker NewsHacker News: swyx posts the Latent Space interview with Diogo Almeida.
swyx4 pointsJev: System One Models for Prod, Not God – With Diogo Almeida, CEO, TypeSafe AIRead the thread on Hacker NewsX: Diogo Almeida in five minutes
X: LLMs vs. Jev, clearly explained
From the Jev guides
Original write-ups on what this entry is for.
From the Jev AI model community
Posts from builders shipping with Jev right now.