# hllama
<img src="assets/hllama-logo.png" style="display: block; margin-left: auto; margin-right: auto;">
`hllama == Harness LLaMA`. `hllama` is a library which aims to provide a set of utility tools for large language models.
## Install
```console
$ pip install hllama
```
## Usage
Test if JSON matches target structure
```python
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
```python
raw_string = "..."
result = json_utils.parse_json_snippet(raw_string)
assert isinstance(result, dict)
assert result is not None
```
Raw data
{
"_id": null,
"home_page": "https://github.com/deep-diver/hllama",
"name": "hllama",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "LLM, Large Language Model, Verification, Utility",
"author": "chansung park",
"author_email": "deep.diver.csp@gmail.com",
"download_url": null,
"platform": null,
"description": "# hllama\n\n<img src=\"assets/hllama-logo.png\" style=\"display: block; margin-left: auto; margin-right: auto;\">\n\n`hllama == Harness LLaMA`. `hllama` is a library which aims to provide a set of utility tools for large language models. \n\n## Install\n\n```console\n$ pip install hllama\n```\n\n## Usage\n\nTest if JSON matches target structure\n\n```python\nfrom hllama import json_utils\n\nA = {\"key1\": str, \"key2\": {\"key3\": str, \"key4\": int, \"key5\": list}}\nB = {\"key1\": \"hello\", \"key2\": {\"key3\": \"world\", \"key4\": 100, \"key5\": [1, 2, 3]}}\n\nresult = json_utils.match_structure(A, B)\nassert result is True\n```\n\nTest if there is JSON part in a string\n\n```python\nraw_string = \"...\"\nresult = json_utils.parse_json_snippet(raw_string)\nassert isinstance(result, dict)\nassert result is not None\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "hllama provides some useful utility functions for LLM.",
"version": "0.0.7",
"project_urls": {
"Homepage": "https://github.com/deep-diver/hllama"
},
"split_keywords": [
"llm",
" large language model",
" verification",
" utility"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d8360d7b7cc2c33f45e68fb9748f0694f0e0a7c36ab3b886f106a82c3e5d32b3",
"md5": "859e16fd091697ff09051c5cbf1fe199",
"sha256": "09445a67cbedab05629b0ff7d2258f44e71ad64bd42532471a3603215c069455"
},
"downloads": -1,
"filename": "hllama-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "859e16fd091697ff09051c5cbf1fe199",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8186,
"upload_time": "2024-04-16T05:00:20",
"upload_time_iso_8601": "2024-04-16T05:00:20.462082Z",
"url": "https://files.pythonhosted.org/packages/d8/36/0d7b7cc2c33f45e68fb9748f0694f0e0a7c36ab3b886f106a82c3e5d32b3/hllama-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-16 05:00:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "deep-diver",
"github_project": "hllama",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "hllama"
}