Skip to main content

LibreFang Python SDK

Official Python client and SDK for the LibreFang Agent OS.

Installation

pip install librefang-sdk

Public APIs

This package provides two different interfaces:

1. REST API Client

Control LibreFang remotely via its REST API.

from librefang import Client

client = Client("http://localhost:4545")

# Create an agent
agent = client.agents.spawn_agent(template="assistant")
agent_id = agent["agent_id"]
print(f"Agent created: {agent_id}")

# Send a message
reply = client.agents.send_message(agent_id, message="Hello!")
print(reply)

# Stream a response
for event in client.agents.send_message_stream(agent_id, message="Tell me a story"):
    if event.get("content"):
        print(event["content"], end="", flush=True)

2. Agent SDK

Write Python agents that run inside LibreFang.

from librefang import Agent

agent = Agent()

@agent.on_message
def handle(message: str, context: dict) -> str:
    return f"You said: {message}"

agent.run()

Or use the simple input/output functions:

from librefang import read_input, respond

data = read_input()
result = f"Echo: {data['message']}"
respond(result)

Examples

See the examples/ directory for more examples:

Client Examples

  • client_basic.py - Basic REST API usage
  • client_streaming.py - Streaming responses

SDK Examples

  • echo_agent.py - Simple echo agent

Requirements

  • Python 3.10+

License

MIT

Metadata

Release files for librefang-sdk 2026.11.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for librefang-sdk 2026.11.11
File Size Uploaded Provenance Actions
librefang_sdk-2026.11.11.tar.gz 570.9 kB With provenance Details for librefang_sdk-2026.11.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for librefang-sdk 2026.11.11
File Interpreter ABI Platform Actions
librefang_sdk-2026.11.11-py3-none-any.whl Python 3 none any Details for librefang_sdk-2026.11.11-py3-none-any.whl

Total release size: 939.0 kB

Release files / librefang_sdk-2026.11.11.tar.gz

Download URL librefang_sdk-2026.11.11.tar.gz
Size 570.9 kB
Tags Source
SHA-256 checksum
How to use checksums
56cadcfb0da9572b9cbd46d6102501f0a3f19468fb55810b86fa8463f96fc62d
BLAKE2b-256 checksum
How to use checksums
6bd2f90e12411d48324ef8ce748f8d3fd59e04886dd3351b8d0fbccce80321be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / librefang_sdk-2026.11.11-py3-none-any.whl

Download URL librefang_sdk-2026.11.11-py3-none-any.whl
Size 368.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70a500c29c710aebc6e7fd06672edc1cdbb48b7c19a20423a8d64d204af017b1
BLAKE2b-256 checksum
How to use checksums
e84212d477bed0515b5002a0db75668a374bbb04dee7a3debc382476eadaafef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for librefang-sdk 2026.11.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for librefang_sdk-2026.11.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2026.11.11 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page