Skip to main content

Gateway-agnostic core for llm-catalog: config schema, resolver, GatewayTransport, and LiteLLM codegen. Knows nothing about any runtime adapter.

Project description

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.10), 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-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.

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

import namespace: llm_catalog.core

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_catalog_core-0.8.1.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_catalog_core-0.8.1-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file llm_catalog_core-0.8.1.tar.gz.

File metadata

  • Download URL: llm_catalog_core-0.8.1.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}

File hashes

Hashes for llm_catalog_core-0.8.1.tar.gz
Algorithm Hash digest
SHA256 e28fe2a30350b535d3bbeb48bb263379dba5c0b22ae81c9f4aeb6b0cd28c1bcd
MD5 5e54eff2106a6853b98f46aca12eff7c
BLAKE2b-256 6abff8427f22df7c4961bdf6e11b7893efb9b1d6a9a2ded1b3c70d74dc194f68

See more details on using hashes here.

File details

Details for the file llm_catalog_core-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: llm_catalog_core-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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}

File hashes

Hashes for llm_catalog_core-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6038de8c7d176ea97073494308a8f55b4868bf8e57b78105b8087d239552ae1
MD5 423ff5aec3914adccbe1f2671a1834e7
BLAKE2b-256 b35811be336f30d2490d90db0c06917a11c3137f5aaf275b75303bcc38a5d833

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page