Custom chatbots: Advanced functions & tips
If you want to adapt your own chatbot to specific requirements or use additional options, you will find tips and extensions here: These include various output formats (such as LaTeX, Markdown, diagrams or code), customizable role models, team functions and tips for use in multiple courses.
The chatbots can output various formatted content. To ensure that this formatting is rendered correctly, the bot should receive appropriate instructions in the system prompt.
LaTeX for mathematical formulas
Mathematical formulas can be output as inline LaTeX and are displayed rendered in the chat.
Example in the system prompt:
You can output mathematical formulas with LaTeX. Use `$...$` for inline formulas. Example: The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. Examples: - Inline: $E = mc^2$ → E = mc² - Fractions: $\frac{1}{2}$ → ½ - Roots: $\sqrt{x^2 + y^2}$ → √(x² + y²) - Sums: $\sum_{i=1}^{n} x_i$ → Σ xᵢ |
Markdown for text formatting
The chatbots can use Markdown syntax to display formatted text. To do this, it is sufficient to indicate in the system prompt to use Markdown for formatted output.
Example in the system prompt:
Use Markdown to format your answers. Available formatting:
|
Program code with syntax highlighting
Programming code can be highlighted in color (syntax highlighting) in different languages.
Example in the system prompt:
When outputting program code, use code blocks with language specification: console.log("Hello, World!");
|
Diagrams with mermaid syntax
The chatbots can output different types of diagrams as mermaid code, which are rendered graphically.
Example in the system prompt:
You can create diagrams with mermaid syntax. Start with ```mermaid and follow the mermaid syntax. graph TD |
Available diagram types:
Diagram type | Diagram type Description | Example use case |
Flowchart | Flowcharts | Processes, decision paths |
Sequence diagram | Sequence diagrams | Interactions between objects |
Gantt diagram | Gantt diagrams | Project schedules |
Class diagram | Class diagrams | UML class structures |
Git graph | Git branches | Visualize version control |
Entity Relationship | ER diagrams | Database relationships |
User Journey | user journeys | Customer Journeys |
Quadrant Chart | Quadrant charts | Prioritization matrices |
XY Chart | XY charts | Function graphs |
Summary of formatting in the system prompt
Here is an example section for the system prompt that covers all formatting
<formatting> |
The ILIAS plugin supports various forms of document integration.
Options at a glance
Option | Option Description | Suitable for |
None | Only the system prompt is used | Simple FAQ bots, ethical coaches |
Context window | Document text is sent with every request | Course materials, scripts, guidelines |
Supported file formats
- PDF (.pdf) - Recommended for scripts, papers, guidelines
- Word (.docx) - For own documents, guidelines
- Text (.txt) - For simple text files, FAQs
To upload documents
- Open the settings of your assistant
- Select "Context window" for document support
- Switch to the "Documents" tab
- Click on "Select file"
- Select your file and click on "Save"
⚠️ Note: This refers specifically to variant 2 (ILIAS + 1 document). Variant 1 (AI toolbox full configuration) has extended options for multiple and larger documents.
Important restrictions for variant 2
- Only one document can be uploaded
- The document should cover a maximum of 30% of the context window
- For larger documents or if you want to use multiple documents, switch to variant 1 (AI toolbox full configuration)
What are tokens?
- A token corresponds to about 3/4 of a word or a character in longer words
- A DIN A4 page of text corresponds to around 500-600 tokens
- Context window is the total memory for system prompt + document + conversation
Recommended document sizes for variant 3 (sorted: local models first)
Model | Context window | Max. Document size (30%) |
gpt-oss:120b (local) | 64,000 tokens | ~19,200 tokens (≈ 32-38 pages) |
Qwen3.5-397b (local) | 32,768+ tokens | ~9,800+ tokens (≈ 16-20+ pages) |
gpt-5-mini (Cloud) | 128,000 tokens | ~38,400 tokens (≈ 64-77 pages) |
gpt-5-nano (Cloud) | 128,000 tokens | ~38,400 tokens (≈ 64-77 pages) |
Model recommendations for the three variants:
💡 Important note: Start with smaller, resource-saving models for simple tasks! Local models (KIT infrastructure, data-sensitive content) remain within the KIT infrastructure and are preferable from a data protection perspective.
Variant | Recommended model | Justification |
Variant 1 (AI toolbox full configuration) | gpt-oss:120b or Qwen3.5-397b (local, KIT infrastructure) | Local models preferred - resource-efficient, data protection-compliant, maximum flexibility |
Variant 2 (ILIAS only) | gpt-oss:120b (local, KIT infrastructure) or gpt-5-nano (cloud) | For simple bots: local models or fastest cloud variant |
Variant 3 (ILIAS + 1 document) | gpt-oss:120b (local, KIT infrastructure) or gpt-5-mini (cloud) | Local models for data protection; cloud for large context windows |
💡 Tip: For data-sensitive applications, we recommend local models such as gpt-oss:120b or Qwen3.5-397b. These remain completely within the KIT infrastructure. A current list of all available models with detailed descriptions can be found on the KI-Toolbox website.
For larger documents: Use variant 1
If you:
- want to provide several documents
- Want to use larger documents (e.g. complete scripts)
- Need central administration for several courses
→ Then we recommend variant 1 (AI toolbox full configuration). This offers significantly more comprehensive setting options and supports multiple documents as a knowledge base. To the instructions for variant 1
Custom chatbots can take on different roles.
Examples of role scenarios
Role | Role description | Field of application |
Socratic tutor | Asks questions, does not give complete solutions | Exercise mode, comprehension questions |
Expert | Subject-specific answers at level | Advanced courses |
Peer coach | Collegial, supportive | Writing center, peer tutoring |
Critical reflection partner | Questions answers, encourages reflection | Ethics seminars, AI competence |
Simulated person | Role play (patient, customer, citizen) | Communication training |
How to configure role-specific bots
The system prompt is decisive for the role:
<role> |
Important: Teachers do not have access to students' conversations. Each user can only view and manage their own conversations.
For students and teachers (as users)
Every person who interacts with the chatbot can manage their own conversations:
View your own conversations
- Open the chatbot in the "Content" tab
- Right sidebar shows your saved conversations
- Click on a conversation to view the history
Rename your own conversations
- Click on the drop-down menu (⋮) next to a conversation
- Select "Rename conversation"
- Enter a title (e.g. "Questions about derivatives")
- Confirm with Enter or Save
Delete your own conversations
- Click on the drop-down menu next to a conversation
- Select "Delete"
- Confirm the deletion
Important: Deleted conversations cannot be restored!
Storage configurable by teachers
Teachers can specify in the chatbot settings whether conversations are saved by default:
- Activate automatic saving: Conversations are saved for the users
- Deactivate automatic saving: Conversations are not saved (privacy-friendly option)
This setting applies equally to all users of the chatbot.
A chatbot can be used in several courses.
Variant 1: Bot per course
Each course has its own chatbot with its own settings.
Advantages:
- Course-specific customizations possible
- Separate conversation histories
- Simple administration per course
Disadvantages:
- Changes must be made in each course
- More effort for updates
Variant 2: Central bot (variant 1) + shared use
One model in the AI toolbox (Open WebUI) is used in several courses.
Advantages:
- Central administration
- Changes apply immediately in all courses
- Consistent answers across all courses
Disadvantages:
- Course-specific adjustments more difficult
- Higher initial set-up effort
Tip: Share models in a team: Custom chatbots and models can also be used in a team via the AI toolbox. Invite team members and work together on the configuration. → Instructions: Working in a team in the AI toolbox
How to set up multi-course use
For variant 1 (bot per course)
- Create an assistant in each course
- Copy the system prompt to each course 3
- Upload the same documents to each course
For variant 2 (central bot)
- Create a model in the AI toolbox (see variant 1) 2
- Configure the model completely in the AI toolbox
- Link an assistant to this model in each course
Frequently asked questions
Prefer local models - these remain within the KIT infrastructure and are more resource-efficient:
- Variant 1 (AI toolbox): gpt-oss:120b or Qwen3.5-397b (local, data protection compliant)
- Variant 2 (ILIAS only): gpt-oss:120b (local) or gpt-5-nano (cloud, fast)
- Variant 3 (ILIAS + 1 document): gpt-oss:120b (local) or gpt-5-mini (cloud, large context window)
For simple bots (FAQ, greeting), start with smaller models. Always choose local models for data-sensitive applications.
Check:
- Is the system prompt clearly formulated?
- Has the correct model been selected?
- Are the documents up-to-date and relevant?
Iterative approach:
- Test with typical student questions
- Analyze the answers
- Customize the system prompt
- Repeat the test
Yes, all course admins can edit the bot. For institutional bots, we recommend variant 1 (AI toolbox) with central administration.
Troubleshooting
The problem | Possible cause | Solution |
Bot does not respond | "Online" not activated | Activate "Online" in the settings |
Incorrect model responses | Wrong model selected | Change model in configuration |
Documents are ignored | Token limit exceeded | Reduce documents or use less |
Bot outputs solutions | System prompt too lax | Sharpen the limits in the prompt |
API error | API key invalid/expired | Generate new key in the AI toolbox |
Slow responses | Large documents/models | Smaller documents, select faster model |
