Skip to main content

hllama provides some useful utility functions for LLM.

Project description

hllama

hllama == Harness LLaMA. hllama is a library which aims to provide a set of utility tools for large language models.

Install

$ pip install hllama

Usage

Test if JSON matches target structure

from hllama import json_utils

A = {"key1": str, "key2": {"key3": str, "key4": int, "key5": list}}
B = {"key1": "hello", "key2": {"key3": "world", "key4": 100, "key5": [1, 2, 3]}}

result = json_utils.match_structure(A, B)
assert result is True

Test if there is JSON part in a string

raw_string = "..."
result = json_utils.parse_json_snippet(raw_string)
assert isinstance(result, dict)
assert result is not None

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hllama-0.0.7-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file hllama-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: hllama-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for hllama-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 09445a67cbedab05629b0ff7d2258f44e71ad64bd42532471a3603215c069455
MD5 859e16fd091697ff09051c5cbf1fe199
BLAKE2b-256 d8360d7b7cc2c33f45e68fb9748f0694f0e0a7c36ab3b886f106a82c3e5d32b3

See more details on using hashes here.

Supported by

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