Skip to content

Commit

Permalink
docs: small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzLaurer committed Dec 12, 2024
1 parent 7a9fb96 commit e89eb06
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/agents.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Agents

!!! note
Standardizing the sharing of tools and agents is in an early experimental stage.

How could the sharing of agents be standardized on the HF Hub?

A good standard for sharing agents should be: modular, open, and interoperable.
Expand All @@ -9,7 +12,7 @@ Agents have four main components:

1. An orchestration library such as [autogen](https://github.com/microsoft/autogen), [CrewAI](https://github.com/crewAIInc/crewAI), [langchain](https://github.com/langchain-ai/langchain), or [transformers.agents](https://huggingface.co/docs/transformers/en/agents), which implements prompt formatting, tool parsing, API calls, agent interaction etc.
2. A set of prompt templates that define different tasks and agent personas.
3. A set of tools, provided as JSON strings, Python dictionaries, or functions.
3. A set of tools, which are essentially a prompt template + code.
4. A compute environment to run the agent code, invoking the prompts and tools.

**Modularity** is a fundamental principle in software engineering. It enables maintainability, reusability, scalability, and testability. In practice, however, the code for LLM systems and agents often combines prompt strings, tool functions and the agent orchestration code in the same files. This means that changes in prompts are hard to test and version and it is harder for others to reuse prompt templates or tools for their own systems.
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/tools.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Tools

This section documents the Tool class.

!!! note
This class is still in an early experimental stage.

This section documents the Tool class.

::: prompt_templates.tools
options:
Expand Down
4 changes: 2 additions & 2 deletions docs/standard_prompt_format.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Standardizing prompt templates

The library expects prompt templates to be stored as modular YAML or JSON files. They can be part of any HF repository, see for example the `Files` tab in these repos for [open-weight model prompts](https://huggingface.co/MoritzLaurer/open_models_special_prompts), [closed-model prompts](https://huggingface.co/MoritzLaurer/closed_system_prompts), or [dataset prompts](https://huggingface.co/datasets/MoritzLaurer/dataset_prompts).
The library expects prompt templates to be stored as modular YAML or JSON files. They can be stored locally or in an HF repository, see for example the `Files` tab in these repos for [open-weight model prompts](https://huggingface.co/MoritzLaurer/open_models_special_prompts), [closed-model prompts](https://huggingface.co/MoritzLaurer/closed_system_prompts), or [dataset prompts](https://huggingface.co/datasets/MoritzLaurer/dataset_prompts).

A prompt template YAML or JSON file must follow the following standardized structure:

Expand Down Expand Up @@ -113,7 +113,7 @@ prompt_template_langchain = prompt_template.to_langchain_template()
- The [simplest use](https://huggingface.co/docs/transformers/en/conversations) is via the text-generation pipeline
- See also details on [chat_templates](https://huggingface.co/docs/transformers/main/en/chat_templating).
- Limitations:
- The original purpose of these chat_templates is to easily add special tokens that a specific open-source model requires under the hood. The `hub_hub_prompts` library is designed for prompt templates for any LLM, not just open-source LLMs.
- The original purpose of these chat_templates is to easily add special tokens that a specific open-source model requires under the hood. The `prompt_templates` library is designed for prompt templates for any LLM, not just open-source LLMs.
- VLMs require special pre-processors that are not directly compatible with the standardized messages format (?). And new VLMs like [InternVL](https://huggingface.co/OpenGVLab/InternVL2-1B/blob/main/tokenizer_config.json) or [Molmo](https://huggingface.co/allenai/Molmo-7B-D-0924) often require non-standardized remote code for image preprocessing.
- LLMs like [command-r](https://huggingface.co/CohereForAI/c4ai-command-r-plus-08-2024) have cool special prompts e.g. for grounded generation, but they provide their own custom remote code for preparing prompts/functionalities properly for these special prompts.

Expand Down
2 changes: 2 additions & 0 deletions docs/standard_tool_format.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Standardizing and Sharing Tools

!!! note
Standardizing the sharing of tools and agents is in an early experimental stage.

## What are LLM tools?

Expand Down
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ repo_name: moritzlaurer/prompt_templates
nav:
- Home:
- Overview: index.md
- HF Hub Repo Types: repo_types_examples.md
- Standard Prompt Format: standard_prompt_format.md
- HF Hub Repo Types: repo_types_examples.md
- Tools: standard_tool_format.md
- Agents: agents.md
- API Reference:
Expand Down Expand Up @@ -75,6 +75,8 @@ markdown_extensions:
anchor_linenums: true
- pymdownx.superfences
- pymdownx.inlinehilite
- admonition
- pymdownx.details

plugins:
- search
Expand Down

0 comments on commit e89eb06

Please sign in to comment.