Skip to main content

Getting started with LLM Assistant

Collection of tools to work with LLMs.

Features

  • CLI for interactive prompt execution.
  • Prompt versioning tool.
  • Prompt definition format and general runner.

How to use

Configuring a LLM provider

The first step is to create a llm-assistannt-config.toml file to hold runner and prompt settings.

[runner]
openai_key = "<OPENAI_KEY>"
model = "gpt-3.5-turbo"
use_cache = true
cache_path = "/home/user/.config/llm-assistant/cache.db"

[prompt]
git_user = "danoan-prompts"
prompt_collection_folder = "/home/user/.config/llm-assistant/cache.db"

[prompt.versioning]
alternative-expression = "v2.0.0"
word-definition = "v1.0.0"

Configuration file search: The application backtracks the current working directory searching for the llm-assistant-config.toml file starting from the current working directory. If no configuration file is found, it searches in the location specified by the environment variable LLM_ASSISTANT_CONFIGURATION_FOLDER.

You can check which configuration file is being used by running

llm-assistant setup

:::{Tip} For different strategies regarding llm-assistant configuration, check the guide . :::

Running a prompt

First thing is to define your prompt config.toml file and store them in the prompt collection folder.

# prompt-collection-folder/alternative-expression/config.toml
name="Alternative Expression"
system_prompt='''
You are fluent speaker of the {language} language and your task is to list at most five expressions that encodes the meaning of a sentence or a word enclosed by double angle brackets.

Your response must be given as a json list and the items must be written in {language}.

'''
user_prompt='''
Language: {language}
Sentence: <<{message}>>
Response:
'''
'''

Then, you can run this prompt by executing

echo "{}" | llm-assistant run alternative-expression --p language portuguese --p message "ganhar a vida"

Starting an interactive session

To start an interactive session, type:

llm-assistant session
╭────────────────────────────────────────────────────────────────────────────────────────╮
│ Select prompt                                                                          │
╰────────────────────────────────────────────────────────────────────────────────────────╯
1. Alternative Expressions 2. Word Definition

Prompt index: 2
╭────────────────────────────────────────────────────────────────────────────────────────╮
│ Choose an option                                                                       │
╰────────────────────────────────────────────────────────────────────────────────────────╯
1. New instance 2. Load instance

Option index: 1
Enter the instance name: portuguese
Enter variable assignment: language=portuguese
╭─────────────────────────────────────── New Chat ───────────────────────────────────────╮
│ Prompt: Word Definition                                                                │
│ Instance:portuguese                                                                    │
╰────────────────────────────────────────────────────────────────────────────────────────╯
Enter messaó
Enter message: $$
╭───────────────────────────── Word Definition::portuguese ─────────────────────────────╮
│ borogodó                                                                              │
╰───────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────── Word Definition::portuguese ─────────────────────────────╮
│ [                                                                                     │
│   "Encanto, atração irresistível e misteriosa; charme",                               │
│   "Qualidade ou característica que atrai e seduz de maneira peculiar ou especial.",   │
│   "Dom, habilidade natural para seduzir ou encantar as pessoas.",                     │
│   "Magia, feitiço; algo que exerce influência sobre os outros de forma inexplicável." │
│ ]                                                                                     │
╰───────────────────────────────────────────────────────────────────────────────────────╯

Syncing prompts

The sync feature allows to fetch the most recent updates from the remote prompt repository and to update the local view.

prompt-manager versioning sync

The synchronization is done according with the prompt.versioning settings.

[prompt]
git_user = "danoan-prompts"
prompt_collection_folder = "/home/user/.config/llm-assistant/cache.db"

[prompt.versioning]
alternative-expression = "v2.0.0"
word-definition = "v1.0.0"

For the settings above, the sync will search for the repositories:

  • danoan-prompts/alternative-expression
  • danoan-prompts/word-definition

on github and then fetch the specified version.

Push prompt version assistant

The prompt-manager versioning push commands guides the user to the creation of a new prompt version, helping to keep your prompts organized and following a versioning policy.

Check the guide for more information.

Contributing

Please reference to our contribution and code-of-conduct guidelines.

Release files for llm-assistant 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-assistant 0.5.1
File Size Uploaded
llm_assistant-0.5.1.tar.gz 54.5 kB Details

Release files / llm_assistant-0.5.1.tar.gz

Download URL llm_assistant-0.5.1.tar.gz
Size 54.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ec0f8b1b18b941e12267b1d9cb0fd23de3c21115d55b534c93dcf8e1778b6589
BLAKE2b-256 checksum
How to use checksums
309a4cfa13b7568ca1dab58159219e9921cd2dffc78f752a2f085a76f8fdbfd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 13, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

1 release file

0.5.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page