Skip to main content

llm-change-agent

Project description

LLM Change Agent

DOI

Overview

LLM Change Agent is a command-line tool designed to interact with various large language models from different providers. It generates KGCL commands using specified models and providers via prompts. Prompts could be GitHub issue description/comments.

Features

  • Given a prompt relevant to making ontology resource changes, the agent responds with KGCL change statements.
  • Supports OpenAI, Ollama, Anthropic and CBORG (LBNL hosted) models.

:warning: OpenAI, Anthropic and CBORG model use are subject to availability of corresponding keys as environment variables locally.

Installation

To install the dependencies, run:

pip install llm-change-agent

Usage

The CLI provides several commands to interact with the language models.

List Available Models

To list all available models from supported providers:

llm-change list-models

OpenAI models:
  gpt-4o-2024-08-06
  gpt-4o-mini
  gpt-4o-mini-2024-07-18
  gpt-4o-2024-05-13
  gpt-4o
  gpt-4-turbo-2024-04-09
  gpt-4-turbo
  gpt-4-turbo-preview
Anthropic models:
  claude-3-5-sonnet-20240620
  claude-3-opus-20240229
  claude-3-sonnet-20240229
  claude-3-haiku-20240307
Ollama models:
  llama3.1
LBL-CBORG models:
  lbl/llama-3
  openai/chatgpt:latest
  anthropic/claude:latest
  google/gemini:latest

Generate Text

To generate text using a specified model and provider:

llm-change execute --model <MODEL_NAME> --provider <PROVIDER_NAME> --prompt "<YOUR_PROMPT>"

Replace <MODEL_NAME>, <PROVIDER_NAME>, and <YOUR_PROMPT> with your desired values.

Examples

  • Generate text using CBORG's lbl/llama-3 model with a custom prompt:
llm-change execute --model lbl/llama-3 --prompt "I want to change the definition of class ABC:123 to 'foo bar' and also create a new class labelled 'bar foo' with the curie DEF:123."

OR

llm-change execute --provider cborg --prompt "I want to change the definition of class ABC:123 to 'foo bar' and also create a new class labelled 'bar foo' with the curie DEF:123."

generates

Final Answer: 

[
  "change definition of ABC:123 to 'foo bar'",
  "create class DEF:123 'bar foo'"
]

Evaluations

Input

The project also contains input data for evaluations in the form of YAML files for the following ontologies:

Expected changes

The expected changes for specific pull requests are listed ontologywise below:

Actual results

The actual results for some of the LLM models evaluated can be fount here and corresponding metrics here

Development

To run the project locally, clone the repository and navigate to the project directory:

git clone https://github.com/yourusername/llm-change-agent.git
cd llm-change-agent
poetry install

Make sure you have poetry installed in your system.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgements

This cookiecutter project was developed from the monarch-project-template template and will be kept up-to-date using cruft.

Project details


Download files

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

Source Distribution

llm_change_agent-0.0.5.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

llm_change_agent-0.0.5-py3-none-any.whl (4.2 MB view details)

Uploaded Python 3

File details

Details for the file llm_change_agent-0.0.5.tar.gz.

File metadata

  • Download URL: llm_change_agent-0.0.5.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for llm_change_agent-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d834e9e4072212e9b7ec9e494e0898d8ef04ef0a3bc7cdd976b876e75f8f1e0a
MD5 c0a5200400255dc2c8b2ad5ff183fa83
BLAKE2b-256 7455e8339309669d1a81d9adbfd9d60eab2d7c56e2b784144fe110dc6c6c2f09

See more details on using hashes here.

File details

Details for the file llm_change_agent-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_change_agent-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 207e6d11d95c4d45a5f034e60460771c60a390e03d4b0ae30168a365bb7a688f
MD5 9dea504ba22c81bf8cba512c5ef2b5cf
BLAKE2b-256 3c38c6383fa5528b38ede9ceed819aadef7c06f3fcf26c349f0bd41be6df85a2

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