Skip to main content

Add your description here

Project description

ag-llm

A Python package that integrates LLM functionality directly into your Python shell experience.

Installation

uv install ag-llm

Or alternatively:

pip install ag-llm

Usage

Once installed, you can use ag directly in your Python shell with a simple syntax:

import ag
ag/"how are you"

This sends your query to the default LLM and streams the response directly in your terminal with beautiful markdown rendering thanks to Streamdown.

Features

  • Direct Python Integration: Use natural Python syntax with the / operator
  • Streaming Responses: Get real-time output as the model generates responses
  • Markdown Rendering: Beautifully formatted output with code highlighting
  • IPython Integration: Automatically hooks into IPython for seamless usage
  • Simple Setup: Just import and start querying

Requirements

  • Python >= 3.8
  • llm for LLM integration
  • streamdown for markdown rendering

Configuration

The package uses the default configuration from the llm package for model selection. You can configure your preferred model using:

llm models default your-model-name

See the LLM documentation for more configuration options.

Example

import ag

# Simple query
ag/"What is the capital of France?"

# More complex query
ag/"Explain quantum computing in simple terms"

How It Works

When you use ag/"your query", the package:

  1. Sends your query to the configured LLM model via the llm package
  2. Streams the response token by token
  3. Renders the output using Streamdown for beautiful formatting
  4. Handles all the complexity behind the scenes

Development

To develop on this package:

git clone [repository-url]
cd ag-llm
uv install

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

ag_llm-0.1.0a1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

ag_llm-0.1.0a1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file ag_llm-0.1.0a1.tar.gz.

File metadata

  • Download URL: ag_llm-0.1.0a1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for ag_llm-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 fa08386c1c1a3e19abc586e7ce77e7beaba374c843d4f83678fb0d00802a03ac
MD5 28a43ab46c851631bccb41e3eda47352
BLAKE2b-256 39316069a0a0e3faf05514695889e1e86bc4ce09c4ba465c9b0bbd56844bdc94

See more details on using hashes here.

File details

Details for the file ag_llm-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: ag_llm-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.4

File hashes

Hashes for ag_llm-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 dcbce77af1f5f9b63f4904560ff7c3ea8ea2bb0146142ac369c71274949ba91a
MD5 2cb00c5bed3e4383eb1fec5d881fed69
BLAKE2b-256 0d3f73cf4e0705d4730276fe1ab06fb3f172a2e4ca908951ce67e17f381f0aef

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