Skip to main content

Low abstraction agentic LLM framework.

Project description

About

Low abstraction LLM framework focused on simple chat / agentic applications.

Supports only Gemini API.

In early alpha development.

Install

pip install llmbrix

Example usage

(see llmbrix/examples/simple_chatbot/)

import dotenv

from llmbrix.chat_history import ChatHistory
from llmbrix.gemini_model import GeminiModel
from llmbrix.tool_agent import ToolAgent
from llmbrix.tools import CalculatorTool, DatetimeTool

dotenv.load_dotenv()

model = GeminiModel(model="gemini-2.5-flash-lite")
chat_history = ChatHistory(max_turns=5)

agent = ToolAgent(
    gemini_model=model,
    system_instruction="You are Kevin, super brief to the point chatbot assistant. Speak in corporate words.",
    chat_history=ChatHistory(max_turns=5),
    tools=[CalculatorTool(), DatetimeTool()],
    loop_limit=2,
    tool_timeout=30,
    max_workers=2,
)


def start_chat():
    print("--- Kevin is online! (Type 'exit' or 'quit' to stop) ---")

    while True:
        user_text = input("You: ")
        if user_text.lower() in ["exit", "quit"]:
            response = agent.chat("I'm leaving, see you!")
            print(f"Kevin: {response.text}")
            break
        try:
            for agent_msg in agent.chat_iter(user_text):
                if agent_msg.is_model() and agent_msg.text:
                    print(f"Kevin: {agent_msg.text}")
                elif agent_msg.is_tool():
                    print(f"Kevin used tool: {agent_msg.tool_name} with args: {agent_msg.tool_args}")
        except Exception as e:
            print(f"Error: {e}")


if __name__ == "__main__":
    start_chat()

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

llmbrix-2.0.0a1.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

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

llmbrix-2.0.0a1-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file llmbrix-2.0.0a1.tar.gz.

File metadata

  • Download URL: llmbrix-2.0.0a1.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for llmbrix-2.0.0a1.tar.gz
Algorithm Hash digest
SHA256 3d6cf4bc1dc4c975c6178c2c42b7423c114865ef9b9975955941c5be16e91e1e
MD5 0ca0d4c80937a056cbd65a4b29b461eb
BLAKE2b-256 21489660743e3d645e6f67f1a325ce1090e7d9098d13195a88cb08fd50f96125

See more details on using hashes here.

File details

Details for the file llmbrix-2.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: llmbrix-2.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for llmbrix-2.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 3654e8e43e938761b44901c82d27e2b09fe103c38ceb1b3111bae3139fde5b4f
MD5 ee337674994279ae3b2faca9aa7351a9
BLAKE2b-256 c9d963a4595092313d6f52d97e0ba43d01c6c63b7c3f0eb86607d5d6de2c7500

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