Skip to main content

LLM Agent

A simple LLM client and AI Agent framework for OpenAI-compatible APIs.

Features

  • LLM: Basic client for OpenAI-compatible APIs with streaming support
  • ReActAgent: Reasoning and Acting agent (coming soon)
  • PlanAndSolveAgent: Planning and problem-solving agent (coming soon)
  • ReflectionAgent: Self-reflective agent (coming soon)

Installation

pip install libagent-ai

Usage

LLM Client

from libagent_ai import LLM

llm = LLM(
    model="glm-4.7",
    apiKey="your-api-key",
    baseUrl="https://api.example.com/v1"
)

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
]

response = llm.think(messages)
print(response)

Using Environment Variables

Create a .env file:

LLM_API_KEY=your-api-key
LLM_BASE_URL=https://api.example.com/v1

Then use:

from libagent_ai import LLM

llm = LLM(model="glm-4.7")
response = llm.think(messages)

Development

# Install dependencies
uv sync

# Run tests
uv run python -m libagent_ai.llm

License

MIT

Metadata

Release files for libagent-ai 0.1.1

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

Source distribution (sdist)

Source distribution for libagent-ai 0.1.1
File Size Uploaded
libagent_ai-0.1.1.tar.gz 21.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libagent-ai 0.1.1
File Interpreter ABI Platform
libagent_ai-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / libagent_ai-0.1.1.tar.gz

Download URL libagent_ai-0.1.1.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
873de0a683f42d9ea703e3d93eb6b964f563af496468fd8b722e67cc574d76a0
BLAKE2b-256 checksum
How to use checksums
10a04cbc0f3ec39392509484f4c3682385a053513667b51aead58dc30d4a4024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / libagent_ai-0.1.1-py3-none-any.whl

Download URL libagent_ai-0.1.1-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9e1134840411311ceab42cc7ac192b81e30ecdbfa5751941c3f9721feb3655e
BLAKE2b-256 checksum
How to use checksums
4af27520d3dfb88aadffafa3deab8ff1a337d148236cdb3dcf9031efc891ea09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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