Skip to main content

A minimal, explicit agent runtime

Project description

Loguit

Loguit is a Python-first, code-first runtime for building agents without LangChain's abstraction bloat. It's designed for complicated, out-there products where hidden layers get in the way.

Core principles:

  • Explicit model and tool calls
  • Framework-owned run state
  • Run-level and step-level middleware
  • Bounded state growth via pruning
  • Basic structured logging

Quickstart

from loguit import Agent, init_model, tool


@tool
def add(a: int, b: int) -> int:
    return a + b


model = init_model("openai:o3-mini")
agent = Agent(model, tools=[add])

result = agent.invoke("Use add to sum 2 and 3, then answer.")
print(result.content)

agent.invoke(...) runs a single prompt through the full model→tool→model loop. agent.repl(...) launches an interactive REPL (type exit or quit to leave). Use tool_execution="parallel" when you want tool calls from a single model step to execute concurrently. Use agent.as_tool(...) to wrap a sub-agent as a normal tool.

Middleware (Run + Step)

from time import time

from loguit import BaseRunMiddleware, BaseStepMiddleware


class RunLogger(BaseRunMiddleware):
    def before_run(self, context, state):  # noqa: ANN001
        print("run start", context.run_id)


class StepTimer(BaseStepMiddleware):
    def before_step(self, context, state, step):  # noqa: ANN001
        step._started_at = time()
    def after_step(self, context, state, step, result):  # noqa: ANN001
        print(step.step_type, time() - step._started_at)

Examples

See examples/ for organized demos:

  • examples/agents/
  • examples/coding/
  • examples/models/
  • examples/mcp/
  • examples/observability/
  • examples/tools/

Anti-goals

Loguit is intentionally narrow in V1:

  • No LangChain API compatibility
  • No graph DSLs or chain abstractions
  • No RAG or vector store framework
  • No durable state persistence
  • No multi-agent orchestration

Why Loguit?

Because you should be able to build complex products without being chained to bloatware.

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

rexion_loguit-0.1.1.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

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

rexion_loguit-0.1.1-py3-none-any.whl (65.8 kB view details)

Uploaded Python 3

File details

Details for the file rexion_loguit-0.1.1.tar.gz.

File metadata

  • Download URL: rexion_loguit-0.1.1.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rexion_loguit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 39d2f9f704cac4c307875e7df1a26266841ef2f7515c9e258fdf4ecebd7c1255
MD5 c8047768063566e0208e78548de8f3d4
BLAKE2b-256 b5cb11598605d955b21ef0ce0c6f6cd4dbe7e0e872a36a6092ea8fe3d37a37af

See more details on using hashes here.

Provenance

The following attestation bundles were made for rexion_loguit-0.1.1.tar.gz:

Publisher: publish-pypi.yml on rexionai/loguit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rexion_loguit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rexion_loguit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 65.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rexion_loguit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 585e63ffbf8c10335b4867c67ba72046ffda704436d10c32ed9b1ee968959a4b
MD5 698b7b3420ca0b8575fb66dfbb13eb5e
BLAKE2b-256 3c4802db52b0814887e47ccf4446ad96c9a26f5a32a2befda1c94dc1e7c3d476

See more details on using hashes here.

Provenance

The following attestation bundles were made for rexion_loguit-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on rexionai/loguit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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