Repository navigation
Releases: rusih100/langfuse-hotswap
Release list
v1.1.1
v1.1.0
Highlights
- langfuse 4.x support. The dependency is now
langfuse>=4,<6. Python SDK v4 is still
supported by Langfuse and is the SDK to use with self-hosted Langfuse v3: SDK v5 needs Langfuse
v4.59.0 or later. Nothing changes in the API or the behavior; the same code works on both. - Both majors tested. CI runs the tests, the SDK contract tests among them, on the lowest
supportedlangfuse4.0.0, and the nightly workflow on the latest 4.x and 5.x releases.
Upgrading
pip install -U langfuse-hotswapNo code changes are needed. To stay on SDK v4, pin langfuse>=4,<5 in your project.
v1.0.1
Highlights
-
Stable API. The first stable release: the public API follows Semantic Versioning from here
on, and nothing in it breaks before 2.0. -
Factory hooks.
hooksonLangfuseChainFactorywraps the model of every chain the factory
creates, so a policy such as retries is set once per process. The chain's own hooks run first,
sowith_structured_outputandbind_toolsstill get the chat model:factory = LangfuseChainFactory( client, models, hooks=[lambda model: model.with_retry(stop_after_attempt=3)], ) chain = factory.create("support-reply").with_structured_output(Reply)
A hook with a
promptparameter receives the prompt client, as a chain hook does. -
Python 3.14. Tested in CI on Python 3.11–3.14.
-
Lighter install. The package no longer depends on
langchain;langchain-coreis enough. -
Lowest versions tested. CI runs the tests on the lowest declared
langchain-core,
langfuse,typing-extensionsandjinja2, not only the latest.
Breaking changes
PromptManageris no longer part of the public API. It was an internal building block of the
runnable;LangfuseChainFactory,LangfusePromptRunnable,LangfusePromptTemplateand the
errors are unchanged.
Migrating from 0.2
v0.2.0
Highlights
- Models live in your code. Pass
ChatOpenAI(...),ChatAnthropic(...)or any LangChain
chat model to the factory by name; the prompt config picks one withprovider. Credentials,
endpoints and HTTP clients never come from Langfuse. - Allow only what you list.
allowed_config_keysisNoneby default: the config selects
the model and changes nothing else. Name the fields editors may tune, or pass"any". - Template formats.
langfuse(the playground rules) by default;f-string,mustache
andjinja2per factory or per prompt. - Simpler core.
PromptManagerowns fetch, compare and rebuild; the runnable is 200 lines.
A cold start fetches once, a broken version is retried when the prompt changes, an outage is
logged once.
Breaking changes
LangfuseChainFactory(client, models=..., allowed_config_keys=None, label=None, template_format="langfuse")create(prompt_name, *, label=None, version=None, **get_prompt_kwargs);fallbackis rejected.- Config key
model_provideris nowprovider. - Removed:
model_kwargs,providers,DEFAULT_ALLOWED_CONFIG_KEYS,is_blocked_config_key,
thebatchoverrides.
Migrating from 0.1
factory = LangfuseChainFactory(
get_client(),
models={"openai": ChatOpenAI(api_key=key, timeout=30)},
allowed_config_keys={"model", "temperature", "max_tokens"},
)Rename model_provider to provider in the prompt configs. Replace create(fallback=...) with
.with_fallbacks([local_chain], exceptions_to_handle=(PromptFetchError,)).
Full list: CHANGELOG.
Docs: https://rusih100.github.io/langfuse-hotswap/
v0.1.1
Added
- Contract tests pin the Langfuse SDK behavior the library relies on: the prompt client fields,
the cache serving a fresh entry as the same object and a stale one without blocking, and the
rendering rules. CI runs the suite on the lowest supportedlangfuseand a nightly workflow on
the latest 5.x release. - Documentation site in English and Russian, published to GitHub Pages; the README is now a short
pitch with an animated demo and links there.README.ru.md examples/: one short script per feature.CHANGELOG.md.
Changed
- Prompts are compared by name, version, content and config iad of the
SDK__eq__; the template renderer is a copy of the SDK one, checked against it by a contract
test. Nothing from the private SDK modules is imported at r - The sdist contains the package, the tests and the changelog only.
Documentation: https://rusih100.github.io/langfuse-hotswap
v0.1.0
First release.
LangfuseChainFactoryandLangfusePromptRunnable: a LangChainRunnablewhose model and parameters come from the Langfuse prompt config and are rebuilt when the prompt changes.- Config allowlist (
DEFAULT_ALLOWED_CONFIG_KEYS) and blocked infrastructure keys (is_blocked_config_key); the provider must be named explicitly. - The last working chain keeps serving when a new prompt version fails to build or Langfuse is unreachable.
- Prompts are rendered with the Langfuse
TemplateParser, placeholders included. with_model,with_structured_outputandbind_toolshooks.
Requires Python 3.11+, langchain>=1,<2, langfuse>=5,<6.
Full Changelog: https://github.com/rusih100/langfuse-hotswap/commits/v0.1.0