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.1.tar.gz (36.2 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.1-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmbrix-2.0.1.tar.gz
  • Upload date:
  • Size: 36.2 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.1.tar.gz
Algorithm Hash digest
SHA256 f66a8a3a5922507926047939a0f0bd29e9b4d32fdbf162760f590d6946968b5e
MD5 f567e0d7f19a14c59bd51b396eb1b0df
BLAKE2b-256 abc25cccf5f55b9e7a1cfeb58b3cd1772706c6cf828c5889bf1552f3516d1586

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llmbrix-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b7f8ff8fa1b2ce920bd060021a6948755ca72ecab38b9e9f4d986934653b355
MD5 dbce70ac5fe1f6056a94bf0fd3781891
BLAKE2b-256 a8c613a3886beb5cab10e1ff6f36f389e012e70a69c48d69ece9c1653a4840df

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