LLM plugin for iaedu-adapter
Project description
llm-iaedu
A plugin for LLM that enables using the iaedu-adapter as a model.
Installation
# Install LLM if you don't have it
pip install llm
# Install this plugin
pip install llm-iaedu
Or for development:
git clone https://github.com/yourname/llm-iaedu.git
cd llm-iaedu
pip install -e .
Setup
-
Get your IAEDU API key from iaedu.pt
-
Set the API key using LLM's key management:
llm keys set iaedu # Paste your API key when prompted
-
Ensure the iaedu-adapter is running:
# In another terminal npm install # if you haven't already # Create a .env file in the iaedu-adapter directory with: echo "IAEDU_API_KEY=your-actual-api-key-here" > .env echo "IAEDU_CHANNEL_ID=your-channel-id-here" >> .env # This is the channel ID for your agent in iaedu.pt echo "IAEDU_ENDPOINT=https://api.iaedu.pt/agent-chat/api/v1/agent/your-agent-id/stream" >> .env # Optional, defaults to the hardcoded value in the adapter # Then start the adapter: npm start # The adapter should be accessible at http://localhost:4000
Usage
Once installed and configured, you can use the iaedu model like any other LLM model:
llm -m iaedu "What is the capital of Portugal?"
You can also use it in chat mode:
llm chat -m iaedu
Configuration
The plugin uses the following environment variable:
IAEDU_ENDPOINT: URL of the iaedu-adapter (default:http://localhost:4000)
Example:
IAEDU_ENDPOINT=http://my-server:8000 llm -m iaedu "Hello"
How it works
This plugin acts as a bridge between LLM and the iaedu-adapter:
- LLM calls the plugin with a prompt
- The plugin retrieves your IAEDU API key using LLM's key management system
- The plugin forwards the request to your iaedu-adapter instance (as multipart/form-data)
- The adapter communicates with the iaedu.pt API using its own channel ID and agent ID (configured in its environment)
- The plugin streams the response back to LLM
Requirements
- LLM installed
- iaedu-adapter running and accessible
- Valid IAEDU API key
- Valid IAEDU channel ID and agent ID configured in the iaedu-adapter's environment
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 llm_iaedu-0.2.tar.gz.
File metadata
- Download URL: llm_iaedu-0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d384a40e5e3f257cb29f1abce83807a710a4aa408a7ca349e31484837d4864e2
|
|
| MD5 |
682327f52987eda817c4b40ac71065f9
|
|
| BLAKE2b-256 |
ddb7c64cade71f8704c5fc772b57a906a7ef7ce3a3f9e5936422cf485837cbfb
|
File details
Details for the file llm_iaedu-0.2-py3-none-any.whl.
File metadata
- Download URL: llm_iaedu-0.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
384b3075abff1195b898ec855aea129662cddc4fd68b827f2bd5a7e5acf04293
|
|
| MD5 |
09cb1ff9014e2c098c10bab00d1fc5e2
|
|
| BLAKE2b-256 |
ffa56fa9e59a225c4f96dae3448ebfd5a0399131b7d78b34034b6343ea93c960
|