Catalog PyPI
Back to packageRELEASE DETAILS

0.0.3

PyPI

aiconfig-extension-llama-guard

An extension for using LLama Guard with aiconfig

Published28 Dec 2023
Direct dependencies5
Transitive dependenciesNot calculated

README

Version 0.0.3 documentation

LLama Guard with AIConfig

LLama Guard is a 7b model released by Meta. This extension allows you to use it with AIConfig.

LLaMA Guard allows you to define your own “safety taxonomy” — custom policies to determine which interactions are safe vs. unsafe between humans (prompts) and AI models (responses). What makes this cool is that it allows you to enforce your own policies ON TOP of the standard guardrails that a model ships with (instead of merely overriding them).

[!NOTE] This extension also loads the entire model into memory.

Part 1: Installating, Importing, and using this extension

  1. Install this module: run pip3 install aiconfig_extension_llama_guard in terminal
  2. Add these lines to your code:
from aiconfig_extension_llama_guard import LLamageGuardParser
from aiconfig.registry import ModelParserRegistry
  1. In code, construct and load the model parser that to from this extension to the registry: ModelParserRegistry.register_model_parser(LLamageGuard()). You can read the docstrings under ModelParserRegistry class for more info o nwhat this does.
  2. Use the LLamageGuard model parser however you please. Check out our tutorial to get started (video walkthrough, Jupyter notebook) You can watch our video tutorial or check our Jupyter notebook tuto

Part 2: Updating & Developing this extension

If you are not developing this extension locally (just using the published extension), feel free to ignore this part

  1. Navigate to extensions/LLama-Guard/python and run this command: pip3 install -e . (this creates a local copy of the python module which is linked to this directory)
  2. Edit and test the extension as you please. Feel free to submit a push request on GitHub!
  3. After you're done testing, be sure to uninstall the local link to this directory if you ever want to use the published version: pip3 uninstall aiconfig_extension_llama_guard

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
accelerate
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
accelerate ==0.25.0runtime
transformers
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
transformers ==4.35.2runtime
torch
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
torch ==2.1.0runtime
asyncio
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
asyncioruntime
python-aiconfig
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
python-aiconfigruntime

Distribution files

2 collected
aiconfig_extension_llama_guard-0.0.3-py3-none-any.whl

bdist_wheel · 6.48 KB · Python py3

Source file
aiconfig_extension_llama_guard-0.0.3.tar.gz

sdist · 6.34 KB · Python source

Source file

Repository

PENDING
lastmile-ai/aiconfig

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:15 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:d42f5ca2f26abd2026b8d4e5071b02a9db320748d18de216ffbdc125a72fe1bb

Other collected versions

View all collected versions →