Skip to content

Worked Examples

End-to-end examples for common research AI patterns using PAIS. Each example is fully runnable with a PAIS API key.

Examples

Example Frameworks Time to run
RAG over Research Papers LlamaIndex, OpenAI SDK ~5 min setup
Agentic Literature Review LangChain, arXiv ~10 min/run
Fine-tuning with Kubeflow Kubeflow Pipelines, HuggingFace ~hours (GPU)
Experiment Tracking (MLflow) MLflow, PyTorch ~30 min
Agentic Code Generation Claude Code, OpenAI SDK ~5 min

Prerequisites

All examples assume:

# Environment variables
export PAIS_API_KEY="pais-sk-..."
export PAIS_API_BASE="https://api.pais.auckland.ac.nz/v1"

# Base Python packages
pip install openai python-dotenv

Additional packages are listed at the top of each example.

Pattern overview

graph TD
    subgraph "Inference only (API key)"
        E1[RAG Pipeline] --> API[PAIS Inference API]
        E2[Lit Review Agent] --> API
        E5[Code Generation] --> API
    end
    subgraph "Active compute (Kubeflow access needed)"
        E3[Fine-tuning] --> GPU[GPU Notebook]
        E4[MLflow Tracking] --> GPU
        GPU --> API
    end