Skip to main content

A simple LLM client wrapper for OpenAI-compatible APIs

Project description

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

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

libagent_ai-0.1.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

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

libagent_ai-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file libagent_ai-0.1.0.tar.gz.

File metadata

  • Download URL: libagent_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for libagent_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29ce2127a0be076e2ad27e83f9d3c5beecf99ee1347054dbfa14cc681504c70c
MD5 cadbf1c09933009e1d09471c2edfcc29
BLAKE2b-256 d10d72e944987d8c7807efd069ec524897fe7436257a23fe962af47c46860ac7

See more details on using hashes here.

File details

Details for the file libagent_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: libagent_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for libagent_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe69fd23938a16a59127a7f70b1f4da642a86babe28c275f009ea9de2a98e0f0
MD5 dcead593f766ffff78f5cb32a8363016
BLAKE2b-256 f03d4971e1ddf736445a0fe833f006e92209e5f177c5a60534f02be60facff4d

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