Skip to main content

Tool calling runtime for text-only LLMs with LangChain support

Project description

llm-tool-runtime

A lightweight, extensible runtime for calling LLM tools and chaining them together. Installable from PyPI for easy integration into your Python projects.

Installation

Install the core package:

pip install llm-tool-runtime

Optional Model Support

Some LLM providers require extra dependencies. You can install them with extras:

  • Google Gemma:
    pip install "llm-tool-runtime[google]"
    
  • OpenAI:
    pip install "llm-tool-runtime[openai]"
    
  • Anthropic:
    pip install "llm-tool-runtime[anthropic]"
    
  • Ollama:
    pip install "llm-tool-runtime[ollama]"
    
  • Together:
    pip install "llm-tool-runtime[together]"
    
  • All supported providers:
    pip install "llm-tool-runtime[all]"
    

Usage

Import and use the runtime in your Python code:

from llm_tool_runtime import ToolRuntime
from langchain_google_genai import ChatGoogleGenerativeAI
llm = ChatGoogleGenerativeAI(model="gemma-3-27b-it")
runtime = ToolRuntime(llm, verbose=True)

@runtime.tool
def add(a: int, b: int) -> int:
    """Add two numbers together."""
    return a + b

result = runtime.run("What is 15 + 27?")
print(result)  # "The result of 15 + 27 is 42."

See example.py and example_chain.py for usage examples.

Features

  • Register and call tools with LLMs
  • Chain tools together for complex workflows
  • Extensible registry for custom tools
  • Error handling and type safety

Documentation

Contributing

Contributions are welcome! Please see the main README for guidelines.

License

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

Support

For issues, suggestions, or questions, please open an issue on the GitHub repository.

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_tool_runtime-0.1.4.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_tool_runtime-0.1.4-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file llm_tool_runtime-0.1.4.tar.gz.

File metadata

  • Download URL: llm_tool_runtime-0.1.4.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llm_tool_runtime-0.1.4.tar.gz
Algorithm Hash digest
SHA256 07dc6d52bd84758e61c77ee92dd6af24954d83d00757104d91d938bb3b130515
MD5 f311c7f4a2d245e4461cb40c78348968
BLAKE2b-256 4aef2ab4d9d0031ea241148927bfe0ffcbaa8210f01a0b89f2cd15f736901eb4

See more details on using hashes here.

File details

Details for the file llm_tool_runtime-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: llm_tool_runtime-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llm_tool_runtime-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cab5e194ac7b437a61d193513f41ac872467d8a9a5984a6dae5c24cb197960ec
MD5 fb408225a174e642308374335f585eec
BLAKE2b-256 ed9926c8ec466aad1fb07c47e06b17179b603993b54abd6b14e87bf4d11883d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page