AI coding assistant and Large Language Models (LLMs) on IDUN

Table of Contents

    IDUN provides access to coding assistant and LLMs that is running locally on IDUN HPC cluster.

    These LLMs are available (updated 2025-08-14):

    Model namePurpose
    openai/gpt-oss-120bGeneral purpose (recommended)
    Qwen/Qwen3-Coder-30B-A3B-InstructAI coding assistant (recommended)
    google/gemma-3-27b-itGeneral purpose
    deepseek-ai/DeepSeek-R1-Distill-Qwen-32BGeneral purpose

    Introduction video

    How to access

    IDUN LLM models are available from NTNU network or NTNU VPN.

    LLM models are available via plugins, web interface or API.

    Web interface (Open WebUI)

    Link: https://idun-llm.hpc.ntnu.no

    Visual Studio Code and Code Server ( plugin Continue.dev )

    Start VS Code locally or Code Server ( VS Code web version) on https://apps.hpc.ntnu.no

    Install extension Continue from VS Code Marketplace.

    Add configuration file by clicking on gear icon in a chat model list (see screenshot):

    Another way to add configuration: Create directory in your user directory ".continue" with a dot at the start. Create configuration file "config.yaml" in that directory.

    File content:

    name: IDUN Assistant
    version: 1.0.0
    schema: v1
    models:
      - name: Coder
        provider: openai
        model: Qwen/Qwen3-Coder-30B-A3B-Instruct
        apiBase: https://ai.hpc.ntnu.no/api/coder/v1
        apiKey: sk-IDUN-NTNU-LLM-API-KEY
        roles:
          - chat
          - edit
          - apply
        capabilities:
            - tool_use
      - name: Autocomplete
        provider: openai
        model: Qwen/Qwen3-Coder-30B-A3B-Instruct
        apiBase: https://ai.hpc.ntnu.no/api/coder/v1
        apiKey: sk-IDUN-NTNU-LLM-API-KEY
        roles:
          - autocomplete
    context:
      - provider: code
      - provider: docs
      - provider: diff
      - provider: terminal
      - provider: problems
      - provider: folder
      - provider: codebase

    Main elements (screenshot):

    Visual Studio Code and Code Server ( plugin Cline )

    Start VS Code locally or Code Server ( VS Code web version) on https://apps.hpc.ntnu.no

    Install extension Cline from VS Code Marketplace.

    Add configuration file by clicking on "Use your own API key" (see screenshot):

    Use this settings:

    API Provider: OpenAI Compatible
    Base URL: https://ai.hpc.ntnu.no/api/coder/v1
    OpenAI Compatible API Key: sk-IDUN-NTNU-LLM-API-KEY
    Model ID: Qwen/Qwen3-Coder-30B-A3B-Instruct

    Visual Studio Code and Code Server ( plugin Roo Code )

    Start VS Code locally or Code Server ( VS Code web version) on https://apps.hpc.ntnu.no

    Install extension Roo Code from VS Code Marketplace.

    Use this settings to change settings (see screenshot):

    API Provider: OpenAI Compatible
    Base URL: https://ai.hpc.ntnu.no/api/coder/v1
    OpenAI Compatible API Key: sk-IDUN-NTNU-LLM-API-KEY
    Model ID: Qwen/Qwen3-Coder-30B-A3B-Instruct

    There is not need to connect to Roo Code cloud, close request:

    JupiterLab ( plugin Jupyter AI )

    Install plugin Jupyter AI. Example with new Python environment:

    module load Python/3.12.3-GCCcore-13.3.0
    python -m venv /cluster/home/USERNAME/JupiterAI
    source /cluster/home/USERNAME/JupiterAI/bin/activate
    pip install jupyterlab
    pip install jupyter-ai[all]

    Start JupyterLab via https://apps.hpc.ntnu.no

    Change Jupyter AI settings:

    Language Model
    - Completion model: OpenAI (general interface)::*
    - Model ID: Qwen/Qwen3-Coder-30B-A3B-Instruct
    - Base API URL: https://ai.hpc.ntnu.no/api/coder/v1

    Inline completions model (Optional)
    - Completion model: OPenAI (general interface)::*
    - Model ID: Qwen/Qwen3-Coder-30B-A3B-Instruct
    - Base API URL: https://ai.hpc.ntnu.no/api/coder/v1

    API Keys: sk-IDUN-NTNU-LLM-API-KEY

    API

    2 API options are available.

    Option 1: Dedicated API for Qwen3-Coder-30B-A3B-Instruct with public API key

    API Provider: OpenAI Compatible
    Base URL: https://ai.hpc.ntnu.no/api/coder/v1
    OpenAI Compatible API Key: sk-IDUN-NTNU-LLM-API-KEY
    Model ID: Qwen/Qwen3-Coder-30B-A3B-Instruct

    Option 2: Open WebUI provides API access to LLM models

    Link: https://idun-llm.hpc.ntnu.no

    Create your Open WebUI API key.

    Click [User Name] > Settings > Account > API keys in the Open WebUI

    Example: Create Python script chat.py to use API:

    #!/usr/bin/python3
    import sys
    import requests
     
    def chat_with_model(token,model,question):
        url = 'https://idun-llm.hpc.ntnu.no/api/chat/completions'
        headers = {
            'Authorization': f'Bearer {token}',
            'Content-Type': 'application/json'
        }
        data = {
          "model": model,
          "messages": [
            {
              "role": "user",
              "content": question
            }
          ]
        }
        response = requests.post(url, headers=headers, json=data)
        return response.json()
     
    my_api_key = sys.argv[1]
    my_model = sys.argv[2]
    my_question = sys.argv[3]
    answer = chat_with_model(my_api_key, my_model, my_question)
    print(answer)

    Use:

    python3 chat.py 'MY-API-KEY' 'openai/gpt-oss-120b' 'Why sky is blue?'

    Example with additional parameters (temperature, top_p, top_k, max_tokens, frequency_penalty, presence_penalty, stop sequences):

    #!/usr/bin/python3
    import sys
    import requests
     
    def chat_with_model(token,model,question):
        url = 'https://idun-llm.hpc.ntnu.no/api/chat/completions'
        headers = {
            'Authorization': f'Bearer {token}',
            'Content-Type': 'application/json'
        }
        data = {
          "model": model,
          "messages": [
            {
              "role": "user",
              "content": question
            }
          ],
          "temperature": 0.6,
          "top_p": 0.95,
          "top_k": 20,
          "max_tokens": 800,
          "frequency_penalty": 0.9,
          "presence_penalty": 1.9,
          "stop": ["Galdhøpiggen", "Storsteinen"]
        }
        response = requests.post(url, headers=headers, json=data)
        return response.json()
     
    my_api_key = sys.argv[1]
    my_model = sys.argv[2]
    my_question = sys.argv[3]
    answer = chat_with_model(my_api_key, my_model, my_question)
    print(answer)

    Example:

    % python3 chat.py 'MY-API-KEY' 'openai/gpt-oss-120b' 'Make list. Mountain per line of the tallest mountains in Norway?'
    
    /Users/pavlokh/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
      warnings.warn(
    {'id': 'chatcmpl-85894db9e7174d4f9dc468d47c95b42f', 'object': 'chat.completion', 'created': 1756735493, 'model': 'openai/gpt-oss-120b', 'choices': [{'index': 0, 'message': {'role': 'assistant', 'content': None, 'refusal': None, 'annotations': None, 'audio': None, 'function_call': None, 'tool_calls': [], 'reasoning_content': 'User wants a list, each line containing a mountain name (presumably the tallest mountains in Norway). They ask: "Make list. Mountain per line of the tallest mountains in Norway?" So we need to provide a list with one mountain per line, presumably ordered by height descending. Should include maybe top 10 or more? Provide names and perhaps heights? The request is simple; no disallowed content.\n\nWe can respond with bullet points or just plain lines. Let\'s give top 10 highest peaks in Norway (including those on islands?). The highest is Galdhøpiggen'}, 'logprobs': None, 'finish_reason': 'stop', 'stop_reason': 'Galdhøpiggen'}], 'service_tier': None, 'system_fingerprint': None, 'usage': {'prompt_tokens': 84, 'total_tokens': 203, 'completion_tokens': 119, 'prompt_tokens_details': None}, 'prompt_logprobs': None, 'kv_transfer_params': None}
    Scroll to Top