flexinfer-llm-kit
Reusable LLM client helpers and speculative decoding workflows for FlexInfer Python services.
Features
- OpenAI-compatible client configuration (LiteLLM / vLLM / OpenAI)
- LangChain
ChatOpenAIfactories for common workloads - Speculative decode workflow (draft → verify → revise) via LangGraph
Installation
From PyPI:
pip install flexinfer-llm-kit
From GitLab:
pip install git+https://gitlab.flexinfer.ai/libs/py-llm-kit.git
Usage
Speculative decode
from llm_kit.spec_decode import spec_decode
result = await spec_decode("Write 3 storyboard panel prompts in JSON.")
Model factories
from llm_kit.clients import get_textgen_model
model = get_textgen_model()
response = model.invoke([{"role": "user", "content": "Hello"}])
print(response.content)
Configuration
| Env Var | Description | Default |
|---|---|---|
LLM_BASE_URL |
OpenAI-compatible base URL (ex: http://litellm.../v1) |
http://litellm.ai.svc:8000/v1 |
LLM_API_KEY |
API key for the endpoint | sk-local |
LLM_TEXTGEN_MODEL |
LiteLLM model id/alias | textgen |
LLM_AGENT_MODEL |
LiteLLM model id/alias | agent |
LLM_VISION_MODEL |
LiteLLM model id/alias | vision |
License
MIT
Publishing (GitLab PyPI)
- Bump
versioninpyproject.toml. - Tag and push:
git tag -a v0.2.0 -m "Release v0.2.0"
git push origin v0.2.0
- In GitLab CI for
libs/py-llm-kit, run the manualpublishjob for that tag pipeline.
Publishing (Public PyPI)
- Set GitLab CI variables:
PYPI_API_TOKENandPUBLISH_PUBLIC_PYPI=true. - Run the manual
publish:pypijob for the tag pipeline.
Metadata
Release files for flexinfer-llm-kit 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flexinfer_llm_kit-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / flexinfer_llm_kit-0.2.1-py3-none-any.whl
| Download URL | flexinfer_llm_kit-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
437cfc3eafd2149dac74e72f6fc13e2f251088e2b33f6c598012ff149caa9321
|
|
BLAKE2b-256 checksum How to use checksums |
531c649866ff44dc46d139fe4aeaa54f7171669badf370a913c17cf8984fa675
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for flexinfer-llm-kit 0.2.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.