langchain-seekrflow
langchain-seekrflow is an open-source integration package that wraps SeekrFlow’s chat model endpoints for seamless use with LangChain. This package provides a simple interface—via the ChatSeekrFlow class—to incorporate SeekrFlow's AI-powered chat models into your LangChain applications.
Note: This integration package is maintained independently from the core LangChain repository. Documentation for LangChain integrations continues to be maintained in the LangChain docs.
Features
- LangChain Compatibility: Implements the LangChain
BaseChatModelinterface. - Streaming Support: Enables token-level streaming of responses.
- Flexible Input Handling: Accepts strings, lists of messages, or dictionary inputs.
- Easy Integration: Designed to work seamlessly with other LangChain components such as prompt templates and chain runners.
Installation
Ensure you have Python 3.10 (or compatible) installed. Then install via Poetry or pip:
Using pip (if published to PyPI)
pip install langchain-seekrflow
Using Poetry
Clone the repository and install dependencies:
git clone https://github.com/yourusername/langchain-seekrflow.git
cd langchain-seekrflow
poetry install
Usage
Below is a quick example demonstrating how to use ChatSeekrFlow:
from langchain.prompts import ChatPromptTemplate
from langchain.schema import HumanMessage
from langchain_core.runnables import RunnableSequence
from langchain_seekrflow import ChatSeekrFlow
from seekrai import SeekrFlow
# Set your Seekr API key
SEEKR_API_KEY = "your-api-key-here"
# Initialize the SeekrFlow client (from seekrai)
seekr_client = SeekrFlow(api_key=SEEKR_API_KEY)
# Instantiate the ChatSeekrFlow model (for non-streaming mode)
llm = ChatSeekrFlow(
client=seekr_client,
model_name="meta-llama/Meta-Llama-3-8B-Instruct"
)
# Synchronous invocation example:
response = llm.invoke([HumanMessage(content="Hello, Seekr!")])
print("Response:", response.content)
# Chaining example:
prompt = ChatPromptTemplate.from_template("Translate to French: {text}")
chain: RunnableSequence = prompt | llm
result = chain.invoke({"text": "Good morning"})
print("Chained response:", result)
# Streaming example:
llm.streaming = True # Enable streaming
for chunk in llm.stream([HumanMessage(content="Write me a haiku.")]):
print(chunk.content, end="", flush=True)
Configuration & Requirements
- API Key: You must have a valid Seekr API key to authenticate requests. Set it as an environment variable or pass it to the
SeekrFlowclient. - Model Endpoint: Ensure your model endpoint is compatible with OpenAI’s chat format.
ChatSeekrFlowcan be used with both fine-tuned and custom SeekrFlow models. - Dependencies: This package depends on
langchain,seekrai, and other libraries specified in thepyproject.toml.
Contributing
Contributions are welcome! Please open issues or pull requests on GitHub to help improve the package. For guidelines, see our Contributing Guide.
License
This project is licensed under the MIT License. See the LICENSE file for details.
API Reference
LangChain maintains documentation for community integrations separately. Once this integration is added to their docs, you’ll be able to find ChatSeekrFlow in the LangChain integrations section.
Until then, refer to this repo’s code and examples for usage.
Happy coding!
Metadata
Release files for langchain-seekrflow 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| langchain_seekrflow-0.1.0.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_seekrflow-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.5 kB
Release files / langchain_seekrflow-0.1.0.tar.gz
| Download URL | langchain_seekrflow-0.1.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78892e7f3d4cbb9ffeefcae82f083f1eae6f16998c9ee9408668db6739a46d66
|
|
BLAKE2b-256 checksum How to use checksums |
6fd53d8d262628f72ee8709064b441b80b3793c1e4e3aa7427cfccd775d76712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.10.12 Darwin/24.3.0
|
Release files / langchain_seekrflow-0.1.0-py3-none-any.whl
| Download URL | langchain_seekrflow-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1fa35e11919d4f31dd2111b44d4e9b80e9ce04da90810394d9f046adfd4032c
|
|
BLAKE2b-256 checksum How to use checksums |
da50a83ce71f6bfb808bac6ae7c2cb2e15028539a92bda39e36ce573c1e996c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.10.12 Darwin/24.3.0
|
Security for langchain-seekrflow 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.