Metadata-Version: 2.4
Name: ollama-json-fixer
Version: 0.1.0
Summary: Force local Ollama models to output strict, valid JSON. Auto-strips markdown fences and retries on failure.
Home-page: https://github.com/khmeeran/-ollama-json-fixer-python
Author: Khader
Author-email: author@example.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# ollama-json-fixer-python
Force local Ollama models to output strict, valid JSON. Zero dependencies beyond `requests`.

![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
![Ollama Compatible](https://img.shields.io/badge/Ollama-Compatible-brightgreen.svg)
![GPU: RTX 3060 Tested](https://img.shields.io/badge/GPU-RTX_3060_Tested-orange.svg)

## Problem
Local LLMs (Llama 3, Mistral, Qwen, Codellama) often wrap JSON in conversational text or markdown fences, breaking json.loads(). This causes JSONDecodeError in production pipelines.

## Solution
- Auto-strips markdown fences
- Regex extraction of JSON blocks
- Auto-retry with strict system prompt
- Works with ANY Ollama model
- Single file - just copy and use

## Quick Start
```bash
pip install requests
python ollama_json_fixer.py
```
