Files
marqdo/doc/design/ext-llm.md
T
cflmyandCursor 3a7e11c995 Add ext/agent layout framework, ext CLI, and docs catch-up.
Ship ABI agent plugin helpers, marqdo ext list/add/remove, and document the agent development roadmap (compose LLM, match/assign).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 13:31:25 +08:00

2.0 KiB

Official extensions (ext/) — LLM

Status Accepted (v0.1.x)
Date 2026-08-06
Related objects.md · ext-abi.md · ext-agent.md · ext-cli.md

Scope

ext/ holds official optional extensions shipped with Marqdo. They are not stdlib (lib/). Users import only what they need:

---
> ext/llm.mq.md
---

Resolution: MARQDO_EXT, ./ext, ext/ next to the binary (same pattern as MARQDO_LIB).

Other official ext: ext-agent.md (agent development framework — layout shipped; orchestration + LLM composition on roadmap). Installer CLI (planned): ext-cli.md. Native plugins: ext-abi.md.

Note: Prefer marqdo ext add llm for end-user install (ext-cli.md). Resolving > ext/llm.mq.md from a repo checkout or local ext/ still works without the installer.

Platform prerequisites

Capability Surface
HTTPS + headers lib/net → http_post / headers= map
Dotenv ## load_env in ext (or load_dotenv / lib/sys)
JSON quote lib/json → quote

ext/llm / ext/大模型 (object handles)

English Chinese Role
## load_env ## 加载环境 Free function: load .env
# llm # 大模型 Object ctor → handle map
## complete / ## chat ## 运行 / ## 聊天 Methods on the handle
---
> ext/llm.mq.md
---

# main

> load_env

*`model` = > llm *
*`reply` = > `model`.complete prompt=Say hi in one word *
> print text=`reply`

Environment (create a project-local .env; do not commit secrets):

OPENAI_API_KEY=sk-...
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o-mini

Fallbacks: MARQDO_LLM_API_KEY, MARQDO_LLM_BASE_URL, MARQDO_LLM_MODEL.

Tests

  • Import smoke: tests/ext/llm-import.mq.md
  • Live complete (local only): tests/ext/llm-complete.mq.md + gitignored tests/ext/.env — do not commit API keys