AI
Summary: OpenCode serves as the working interface, or agent harness. The Academic Cloud (SAIA with API access) provides OpenAI-compatible LLM endpoints that can, under certain conditions, be used in OpenCode in a GDPR-oriented way. Together, this combination offers controllable, desktop-based access to powerful models that suits academic workflows well – in Obsidian, in the terminal or in an IDE (e.g. VS Code).
The configuration documented here is a snapshot and the result of an experimental setup on macOS (Golden Gate) and Linux (Mint). Model catalogue, context windows, limits, API parameters and OpenCode syntax can be adapted to each project. Before productive use, /models and the current SAIA documentation should therefore be checked.
The combination of OpenCode and the Academic Cloud is interesting for several reasons:
@note.md) or read by a tool that has been explicitly permitted. This is easier to control than an opaque agent harness.Whether a specific use is permissible depends not on the model name but on the entire workflow. Before using personal, confidential or research-related data, the following points in particular need to be clarified:
Tab. 1: Data types and appropriate handling (own representation)
| Data type | Appropriate handling |
|---|---|
| Public literature, self-written drafts | Can be processed after a normal quality check. |
| Internal teaching materials, unpublished manuscripts | Only with a clarified institutional basis; selectively rather than the whole vault. |
| Interview data, performance data, expert assessments, personal cases | Pseudonymise consistently beforehand; when in doubt, do not process externally. |
| Particularly sensitive data | As a rule, a local/isolated solution or an explicitly approved service. |
The SAIA API can be reached via this OpenAI-compatible base endpoint: https://chat-ai.academiccloud.de/v1
The endpoint and the available models must be checked before any new setup.
API keys and other credentials never belong in Git, Markdown notes or screenshots. A local .env file could look like this:
ACADEMIC_CLOUD_API_KEY="<your-new-api-key>"
ACADEMIC_CLOUD_ARCANA_ID="<arcana-collection-id>" # only if Arcana is used
chmod 600 .env sets restrictive read permissions on macOS/Linux. The .env file also belongs in .gitignore.
Note
An API key that was previously exposed should be rotated. A new key is the cheapest security gain of this entire architecture.
All OpenAI-compatible providers or endpoints and the parameters of the individual models must be entered in ~/.config/opencode/opencode.json. The exact OpenCode schema version may differ; this template shows the essential fields:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"academic-cloud": {
"npm": "@ai-sdk/openai-compatible",
"name": "Academic Cloud",
"options": {
"baseURL": "https://chat-ai.academiccloud.de/v1",
"apiKey": "{env:ACADEMIC_CLOUD_API_KEY}"
},
"models": {
"openai-gpt-oss-120b": {
"name": "GPT-OSS 120B – Reasoning",
"limit": { "context": 131072, "output": 32768 },
"variants": {
"low": { "reasoningEffort": "low" },
"medium": { "reasoningEffort": "medium" },
"high": { "reasoningEffort": "high" }
}
},
"qwen3-coder-next": { "name": "Qwen 3 Coder Next" },
"qwen3-30b-a3b-instruct-2507": { "name": "Qwen 3 30B A3B" }
}
}
}
}
The limits shown above are no guarantee for the future. A model may have a large nominal context window, while the effectively usable context is usually smaller because of output reserves, tool calls, server limits or timeouts.
To start OpenCode with all environment variables and keys, run the following in the terminal:
set -a
source /path/to/.env
set +a
opencode
If everything works so far, you can run the following tests in OpenCode:
/models to check that the provider and the desired model appear in the list (note: frequently used models appear under Recent).Reply exactly with: Connection successful.@test.md Summarise this note in three bullet points.With GPT-OSS models, you can also switch between the defined performance variants low, medium and high using Ctrl + T. Please verify this key binding in the current OpenCode interface.
.env FileA typical stumbling block: the Obsidian plugin does not necessarily load an .env file itself. A local wrapper can load the variables and then start OpenCode (example for macOS with a Homebrew installation of OpenCode):
#!/usr/bin/env bash
set -a
source "$HOME/.config/opencode/.env"
set +a
exec /opt/homebrew/bin/opencode "$@"
.env Permanently via ~/.zshrcIf you only use OpenCode in the terminal and do not want a wrapper, you can load the variables at every shell start. To do so, add the following to ~/.zshrc (on Linux Mint with Bash: ~/.bashrc):
# OpenCode / Academic Cloud: load keys from .env
if [ -f "$HOME/.config/opencode/.env" ]; then
set -a
source "$HOME/.config/opencode/.env"
set +a
fi
Then restart the shell or run source ~/.zshrc, and use echo ${ACADEMIC_CLOUD_API_KEY:+set} to check that the variable is available (the output only shows “set”, not the key).
There are a few limitations:
~/.zshrc. The Obsidian plugin will therefore only find the variables if Obsidian is started from a terminal (open -a Obsidian). For use with Obsidian, the wrapper remains the more robust solution.source executes the file as shell code. Values containing spaces or special characters must therefore be quoted, and the .env file may only contain content you trust (do not forget chmod 600)..env only takes effect in new shells.If necessary, determine the path to the OpenCode binary with which opencode. The wrapper is then registered as the OpenCode command in the plugin.
Staging workflow for automated changes in the vault
A staging workflow makes sense for automated changes to the vault: 00_Inbox → Staging → human review → final filing. This prevents an agent from writing well-intentioned but wrong organisation directly into the garden.
Tab. 2: Selected Academic Cloud models for different uses (own representation)
| Task | Option | Reason for choice |
|---|---|---|
| General, fast work | GPT-OSS 120B, low |
Very versatile and fast in tests so far |
| Demanding qualitative analysis | GPT-OSS 120B, high |
Best tested quality of results |
| Coding | Qwen 3 Coder Next | Very fast in the coding test; quality needs further testing. Also suitable for agentic tasks |
| Research and academic writing | Qwen 3 30B A3B | Very fast in the test with average quality |
Note: These are not performance and quality tests in the strict sense but heuristic, experimental tests.
In the following, I would like to describe a few use cases that I have been experimenting with so far.
Goal: Not simply to summarise literature, but to process it transparently into evidence, to find (critical) counter-positions and to assess applicability.
Workflow:
Example prompt:
Read @article.md. Write an evidence note in English with:
1) research question and design,
2) robust findings with the location in the text,
3) limitations and counter-positions,
4) assessment of transferability to social management/teaching.
Do not invent references or page numbers. Explicitly flag missing evidence.
Note: It is advisable to work only with Markdown files at first. PDFs cannot easily be processed in the Academic Cloud without a suitable conversion (e.g. with docling).
Extension with a local Zotero MCP:
Zotero PDF → local Beaver Zotero MCP → OpenCode → LLM → evidence note
A corresponding installation guide will be added later. The retrieval step thus remains locally controllable; the LLM receives only the text excerpt required for the request.
Goal: To get from a module assignment to a consistent, evidence-based course – without outsourcing the subject-specific and didactic decisions.
Suitable subtasks:
Robust workflow:
flowchart TD
A[Module assignment & framework] --> B[Didactic concept]
B --> C[Material and source base]
C --> D[Drafts: sessions, tasks, rubrics]
D --> E[Instructor review]
E --> F[Moodle / Excalidraw / presentation]
F --> G[Evaluation & next iteration]
Example prompt:
Use @module-description.md and @teaching-concept.md. Develop a first plan
for 14 sessions. For each session, give the learning objective, preparatory reading,
activity, output artefact and link to the assessment.
Flag all assumptions that do not follow from the files.
Format as a Markdown table.
Didactic guardrail: The agent generates material and variants in the respective working directory. Afterwards, the learning level, fit with the group, assessment alignment and subject-matter accuracy must be checked.
Goal: To search a documented collection (e.g. project material, literature or course corpus) semantically and to process the results further in OpenCode.
Arcana is a Retrieval-Augmented Generation (RAG) service that enables you to interact with documents – such as research papers, manuals or study materials – using natural language. For detailed documentation: https://docs.hpc.gwdg.de/services/ai-services/arcana/index.html
Arcana was connected via the chat completions API with two special parameters:
"enable-tools": true"arcana": { "id": "…" }Since OpenCode does not map this additional request logic automatically, a custom tool, e.g. arcana_search.ts, can pass on the natural-language request. The IDs are integrated exclusively via environment variables:
OpenCode → arcana_search.ts → Academic Cloud + Arcana corpus → hits → LLM synthesis → Markdown draft
Working rules for good RAG:
_Staging; do not let the model write directly into notes.Example prompt:
Search the Arcana corpus for positions on “digital gardening as reflective
teaching practice”. First give a maximum of eight hits with source and relevance.
Only then write a synthesis. Separate findings, interpretation and open
questions. No statement without a traceable source.
ARCANA/RAG with Obsidian
For many Obsidian tasks, RAG is not strictly necessary: a well-linked, atomic Markdown vault can often be followed more easily through file search, wikilinks and deliberate context passing. RAG is mainly worthwhile for larger, less well-structured corpora.
/new.There are a few workarounds for the following problems:
Tab. 3: Problems and countermeasures when using OpenCode and the Academic Cloud (own representation)
| Problem | Countermeasure |
|---|---|
| Too much material | Search → selection → chunks → synthesis instead of the full corpus in the prompt. |
| Slow/unstable responses | Use a small control prompt, switch models, use streaming and repeat the test. |
| Response stays empty | Check the reasoning setting and max_tokens; with Qwen/Mistral, reduce thinking/reasoning if needed. |
| Unclear source basis | Make citations/references mandatory and check them against the primary source. |
| Risky vault changes | Staging, diff, backup and explicit approval. |
Instead of summarising this tutorial once more, a number of principles can be derived from these tests that may also transfer to other workflows and development environments:
Still open: Arcana
Arcana is a Retrieval-Augmented Generation (RAG) service that enables you to interact with documents – such as research papers, manuals or study materials – using natural language. I want to examine how Arcana can be integrated into this workflow – as a complement to the vault, without sensitive documents being uploaded unchecked.
● Seedling
● Growing
● Evergreen