explaingit

ramp-public/portallib

Analysis updated 2026-05-18

18PythonAudience · researcherComplexity · 4/5Setup · moderate

TLDR

An alpha Python library for training and porting compact LoRA adapters across different language models without retraining each one from scratch.

Mindmap

mindmap
  root((PorTAL))
    What it does
      Portable LoRA adapters
      Cross model transfer
      Base agnostic task latent
    Tech stack
      Python
      PyTorch
      Hugging Face PEFT
    Use cases
      Train once reuse often
      Export standard adapters
      Config driven CLI
    Audience
      ML researchers
      LLM engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Train a task adapter once and reuse it across multiple language model families.

USE CASE 2

Export a PorTAL adapter as a standard Hugging Face PEFT adapter for existing pipelines.

USE CASE 3

Run reproducible training, refitting, and evaluation jobs from TOML config files in a container.

USE CASE 4

Evaluate how much a ported adapter improves over the base model's accuracy.

What is it built with?

PythonPyTorchHugging FacePEFT

How does it compare?

ramp-public/portallib1038lab/comfyui-agnes-aiandyuneducated/resolve-ai
Stars181818
LanguagePythonPythonPython
Setup difficultymoderateeasyhard
Complexity4/52/54/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

GPU training needs a CUDA-compatible PyTorch build matched to your platform.

In plain English

PorTAL, short for Portable Task Adapters for LLMs, is a Python research library built by Ramp Labs for training and sharing small, portable pieces of machine learning models called LoRA adapters. Normally, an adapter trained for one language model has to be retrained from scratch to work with a different base model. PorTAL tries to solve this by learning a shared representation of a task that is not tied to any single base model, plus a lightweight decoder for each specific base model that turns that shared representation into a standard LoRA adapter. In practice, this means a task can be trained once, then adapted to work with several different frozen language models, and finally exported as an ordinary Hugging Face PEFT adapter that works with the usual PyTorch and Hugging Face tools. The library, called portallib, handles loading, training, saving, publishing, and exporting these PorTAL adapters. The project ships with a set of ready made recipes that reproduce the training and evaluation approach described by Ramp Labs, along with several prebuilt adapters hosted on Hugging Face for models such as Qwen3 in 1.7 billion, 4 billion, and 8 billion parameter sizes, as well as Gemma 3. Installing the base library is a simple pip install, with an optional extra for the training dependencies and Hugging Face integrations. Python 3.11 and 3.12 are supported, and GPU training requires a CUDA compatible version of PyTorch. Beyond the plain Python workflows, the project also includes a command line interface driven by TOML configuration files, useful for running training, refitting, and evaluation jobs inside containers or scheduled automation. The CLI validates configuration files before running, reports progress as JSON lines, and reads authentication tokens from environment variables rather than the configuration files themselves, keeping credentials separate from recipe files. The README notes this is an alpha research release, so its APIs and file formats may still change before a stable version ships.

Copy-paste prompts

Prompt 1
Help me install portallib with the training extras and load a pretrained PorTAL artifact.
Prompt 2
Explain the difference between source training and target refitting in PorTAL.
Prompt 3
Show me how to write a TOML config file to refit a PorTAL task to a new base model.
Prompt 4
Walk me through exporting a PorTAL task as a standard PEFT LoRA adapter.

Frequently asked questions

What is portallib?

An alpha Python library for training and porting compact LoRA adapters across different language models without retraining each one from scratch.

What language is portallib written in?

Mainly Python. The stack also includes Python, PyTorch, Hugging Face.

How hard is portallib to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is portallib for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.