Skip to main content

llm-catalog-core

Runtime-agnostic core for llm-catalog. It holds the config schema (shipped as schema.json for editor validation; parity with ai-sdk-catalog 0.13), validation, role resolution, the path-rewriting GatewayTransport, native LiteLLM codegen, and an embedded models.dev price snapshot that fills a model's missing cost by vendor and model id (an explicit cost in the config always wins).

This package knows nothing about any runtime adapter and never touches the filesystem, so installing it pulls in neither Pydantic AI nor LiteLLM. Use it directly when you only need resolution or codegen. Otherwise install one of the adapter distributions (llm-catalog-pydantic-ai, llm-catalog-ai-sdk, llm-catalog-litellm), which depend on this.

The config format is JSON, shared verbatim with ai-sdk-catalog — read the file yourself and hand the parsed mapping to Catalog, which validates it:

import json
from pathlib import Path

from llm_catalog.core import Catalog

config = json.loads(Path("ai-sdk-catalog.json").read_text(encoding="utf-8"))
cat = Catalog(config)
rm = cat.resolve_role("fast")  # -> ResolvedModel (no adapter types)
print(rm.kind, rm.vendor, rm.base_url)  # "gateway" or "direct"

To keep using YAML, parse it yourself (e.g. yaml.safe_load) and pass the result the same way.

GatewayTransport comes in two flavours with identical behaviour, because vendor SDKs are split between httpx and its continuation httpx2:

  • llm_catalog.core.transport (also re-exported from llm_catalog.core) for httpx clients, e.g. LiteLLM with openai<3.
  • llm_catalog.core.transport2 for httpx2 clients (openai>=3, anthropic>=1, Pydantic AI, the AI SDK for Python); install the optional dependency with pip install "llm-catalog-core[httpx2]".

Build one for a resolved model with GatewayTransport.for_model(inner, rm).

See the repository README for the full picture, the public/private boundary, and the verification notes.

import namespace: llm_catalog.core

Metadata

Release files for llm-catalog-core 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-catalog-core 0.9.1
File Size Uploaded
llm_catalog_core-0.9.1.tar.gz 31.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-catalog-core 0.9.1
File Interpreter ABI Platform
llm_catalog_core-0.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 71.6 kB

Release files / llm_catalog_core-0.9.1.tar.gz

Download URL llm_catalog_core-0.9.1.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
db8b2a353104f80a7f5a3340643f2149bdcf293a429679a1e0f6b4b658b8c0fe
BLAKE2b-256 checksum
How to use checksums
b1cb88cb002f8e0a69d5fd4610e7ae90a6e9ff9f3f4f016138ef39f2890135e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llm_catalog_core-0.9.1-py3-none-any.whl

Download URL llm_catalog_core-0.9.1-py3-none-any.whl
Size 39.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5c5c5b2eb22ff908d7072477100a56f1ed171ec84281f10b8dc1a94d8bf013d
BLAKE2b-256 checksum
How to use checksums
f39c755c5a9caa8203f2c02cbe5f204ecc503bcd14bfbe035d9dca4c982b178d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

This release

0.9.1 This release

2 release files

0.9.0

2 release files

0.8.8

2 release files

0.8.7

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page