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.0.tar.gz (35.0 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.0-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmbrix-2.0.0.tar.gz
  • Upload date:
  • Size: 35.0 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.0.tar.gz
Algorithm Hash digest
SHA256 abeea098470dd8aef8b42b9ca8a5f8581efef42d928b0510ed2734283e2f7575
MD5 99ace757cbe9c4b3b82f0b8d6dbde428
BLAKE2b-256 a0e96f391e653ab195da8f48b602ca380e498c700a2696955e896dd9511c3571

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llmbrix-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c4d899ea68e735caefe47dcf7a1d29cd094dc6c95f3f1d288882b10d0c2ea22
MD5 15a99a64498a01d438a387912391f998
BLAKE2b-256 237ec176428eada6dedea9be55f152d2fd5c6fcd2c59a8c31a5048e8b922c4e4

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