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

Uploaded Python 3

File details

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

File metadata

  • Download URL: libagent_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 21.2 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.1.tar.gz
Algorithm Hash digest
SHA256 873de0a683f42d9ea703e3d93eb6b964f563af496468fd8b722e67cc574d76a0
MD5 087745ec3ae36caf7c4ac30d0adbe11c
BLAKE2b-256 10a04cbc0f3ec39392509484f4c3682385a053513667b51aead58dc30d4a4024

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libagent_ai-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9e1134840411311ceab42cc7ac192b81e30ecdbfa5751941c3f9721feb3655e
MD5 dd2b292c7e28dbd3fc977e6492b403b7
BLAKE2b-256 4af27520d3dfb88aadffafa3deab8ff1a337d148236cdb3dcf9031efc891ea09

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