Skip to content
Apothem
Comparison

Apothem vs. raw GLM backend wiring

Why route GLM (Z.ai) backend configuration through Apothem instead of hand-wiring environment variables per project.

GLM (Z.ai) is a model backend a compatible tool points at by setting a base URL and a key. You can export those environment variables by hand, per project, per machine, forever. Apothem's glm adapter records the backend endpoints and operator-configurable placeholders in one provider file and writes the same template into every project. This page contrasts hand-wiring that backend against managing it with Apothem.

Effort comparison

TaskRaw hand-configApothem-managed
Record the backend URLsMemorize and re-export per projectWritten into one provider file
Source of truthEach shell's own exportsOne canonical provider file
Keep backends aligned across projectsRe-wire per projectThe same template is written to each project when the file is absent; later edits stay in each project's file
Restore the configRe-export in every projectapothem update --harness glm --project <path> writes the file again only when it is missing
Remove the configManual deleteapothem uninstall backs the file up, then removes it only while it is the unedited template Apothem wrote

What Apothem manages

The glm adapter writes a single provider file at <project>/.apothem/providers/glm.toml and writes nothing else. It records the Anthropic-compatible base URL (https://api.z.ai/api/anthropic), the OpenAI-compatible base URL (https://api.z.ai/api/coding/paas/v4), an auth-token placeholder, and model-mapping placeholders. Your Z.ai key and your model-id choices stay operator-owned — Apothem never writes a real secret and pins no version-volatile model id.

Migration path

  1. Run apothem profile init to create the shared profile if you have not yet. The glm file takes nothing from the profile, but every install and update run loads it.
  2. Run apothem install --harness glm --project <path> to write the glm.toml provider file.
  3. Fill in your Z.ai key and the model ids you want from the current Z.ai documentation.
  4. Run apothem verify --harness glm --project <path> to confirm the config landed.
  5. Edit .apothem/providers/glm.toml for every later change. Apothem never rewrites an existing provider file; apothem update --harness glm --project <path> writes it again only when it is missing.

On this page