Skip to main content

Installation

Install officeLLM in your TypeScript or JavaScript project.

Package Installation

npm install officellm zod@^4.0.0
or
yarn add officellm zod@^4.0.0
or
pnpm add officellm zod@^4.0.0

Peer Dependencies

officeLLM requires the following peer dependencies:
  • zod: ^4.0.0 - For type validation and schemas
  • Node.js: >=18.0.0 - For ES modules support

Provider SDKs (Optional)

To use real LLM providers instead of mock implementations, install the relevant SDKs:
# For OpenAI
npm install openai

# For Anthropic
npm install @anthropic-ai/sdk

# For Google Gemini
npm install @google/generative-ai
The mock implementations work out of the box for testing and development. Real provider integrations require API keys and the corresponding SDKs.

TypeScript Setup

officeLLM is built with TypeScript and provides full type safety. Ensure your tsconfig.json includes:
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "node",
    "strict": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true
  }
}

Environment Setup

Create a .env file in your project root:
# At least one provider API key is required
OPENAI_API_KEY=sk-your-openai-key-here
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here
GEMINI_API_KEY=your-gemini-key-here
OPENROUTER_API_KEY=sk-or-v1-your-openrouter-key-here

Next Steps