This release is a pre-release and may not be stable for production use.
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:
- Sends your query to the configured LLM model via the
llmpackage - Streams the response token by token
- Renders the output using Streamdown for beautiful formatting
- Handles all the complexity behind the scenes
Development
To develop on this package:
git clone [repository-url]
cd ag-llm
uv install
License
MIT
Release files for ag-llm 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ag_llm-0.1.0a1.tar.gz | 19.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ag_llm-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.6 kB
Release files / ag_llm-0.1.0a1.tar.gz
| Download URL | ag_llm-0.1.0a1.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa08386c1c1a3e19abc586e7ce77e7beaba374c843d4f83678fb0d00802a03ac
|
|
BLAKE2b-256 checksum How to use checksums |
39316069a0a0e3faf05514695889e1e86bc4ce09c4ba465c9b0bbd56844bdc94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.4
|
Release files / ag_llm-0.1.0a1-py3-none-any.whl
| Download URL | ag_llm-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dcbce77af1f5f9b63f4904560ff7c3ea8ea2bb0146142ac369c71274949ba91a
|
|
BLAKE2b-256 checksum How to use checksums |
0d3f73cf4e0705d4730276fe1ab06fb3f172a2e4ca908951ce67e17f381f0aef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.4
|