Utility for proving local-only Ollama model installation and handling JSON transport.
# Source: https://github.com/AgriciDaniel/claude-obsidian | License: MIT | Copyright 2026 AgriciDaniel (AI Marketing Hub)
# Provided via justclaw.it.com; keep this notice with the code.
"""Shared proof that an Ollama model is installed and local-only.
This module also owns the direct JSON transport used by every provider
helper: no ambient proxies, no automatic redirects, one bounded response
read, strict duplicate-rejecting JSON, and one wall-clock deadline per
request. The deadline is enforced on every socket send and receive, so a
server that drips bytes cannot hold a request past its stated timeout.
"""
import functools
import http.client
import io
import re
import time
import urllib.request
from claude_obsidian.json_utils import strict_json_loads
MODEL_RE = re.compile(
r"[A-Z
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key