Skip to main content

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

  1. Get your IAEDU API key from iaedu.pt

  2. Set the API key using LLM's key management:

    llm keys set iaedu
    # Paste your API key when prompted
    
  3. 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:

  1. LLM calls the plugin with a prompt
  2. The plugin retrieves your IAEDU API key using LLM's key management system
  3. The plugin forwards the request to your iaedu-adapter instance (as multipart/form-data)
  4. The adapter communicates with the iaedu.pt API using its own channel ID and agent ID (configured in its environment)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_iaedu-0.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

llm_iaedu-0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

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

Hashes for llm_iaedu-0.2.tar.gz
Algorithm Hash digest
SHA256 d384a40e5e3f257cb29f1abce83807a710a4aa408a7ca349e31484837d4864e2
MD5 682327f52987eda817c4b40ac71065f9
BLAKE2b-256 ddb7c64cade71f8704c5fc772b57a906a7ef7ce3a3f9e5936422cf485837cbfb

See more details on using hashes here.

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

Hashes for llm_iaedu-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 384b3075abff1195b898ec855aea129662cddc4fd68b827f2bd5a7e5acf04293
MD5 09cb1ff9014e2c098c10bab00d1fc5e2
BLAKE2b-256 ffa56fa9e59a225c4f96dae3448ebfd5a0399131b7d78b34034b6343ea93c960

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