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:
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa08386c1c1a3e19abc586e7ce77e7beaba374c843d4f83678fb0d00802a03ac
|
|
| MD5 |
28a43ab46c851631bccb41e3eda47352
|
|
| BLAKE2b-256 |
39316069a0a0e3faf05514695889e1e86bc4ce09c4ba465c9b0bbd56844bdc94
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcbce77af1f5f9b63f4904560ff7c3ea8ea2bb0146142ac369c71274949ba91a
|
|
| MD5 |
2cb00c5bed3e4383eb1fec5d881fed69
|
|
| BLAKE2b-256 |
0d3f73cf4e0705d4730276fe1ab06fb3f172a2e4ca908951ce67e17f381f0aef
|