resolve_ollama_host (leann/settings.py)

LEANN · packages/leann-core/src/leann/settings.py · python · MIT
ai, AI / Agents

Python helpers resolving LLM provider URLs and API keys from env.

# Source: https://github.com/StarTrail-org/LEANN | License: MIT | Copyright 2025 LEANN Contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""Runtime configuration helpers for LEANN."""

from __future__ import annotations

import json
import logging
import os
from typing import Any

logger = logging.getLogger(__name__)

# Default fallbacks to preserve current behaviour while keeping them in one place.
_DEFAULT_OLLAMA_HOST = "http://localhost:11434"
_DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1"
_DEFAULT_ANTHROPIC_BASE_URL = "https://api.anthropic.com"
_DEFAULT_MINIMAX_BASE_URL = "https://api.minimax.io/v1"
_DEFAULT_NOVITA_BASE_URL = "https://api.novita.ai/openai"
_DEFAULT_ATLASCLOUD_BASE_URL = "https://api.atlascloud.ai/v1"


def _clean_url(value: str) -> s

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key