Python LLM Output Cleaner: llmclean Package Released

Just published my first open-source Python package — llmclean If you've ever piped raw LLM output directly into json.loads() and watched it explode, this is for you. Three utilities, zero dependencies: • strip_fences — removes the ```json ``` wrappers LLMs love to add • enforce_json — extracts valid JSON even when the model returns True instead of true, trailing commas, unquoted keys, or buries the JSON in prose • trim_repetition — cuts the looping tail when a model repeats itself Every function fails gracefully — if cleaning fails, you get the original back. It never throws. use with : pip install llmclean GitHub: https://lnkd.in/gQt4auQ2 PyPI : https://lnkd.in/guNpmtnm Built this because I kept copy-pasting the same cleaning logic across projects. Figured someone else probably was too. #Python #OpenSource #LLM #AI #Dev

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories