Skip to main content

Provider Architecture

Each provider implements the IProvider interface:

Step-by-Step Guide

1. Create Provider Class

Extend BaseProvider and implement the required methods:

2. Register the Provider

Add your provider to the factory registry:

3. Update Type Definitions

Add your provider type to the union:

4. Use in Agents

Example: Adding Ollama Support

Best Practices

Error Handling

Rate Limiting

Tool Support

If your provider doesn’t support tools natively:

Testing

Provider Registry

officeLLM maintains a global provider registry:

Contributing

When adding a new provider:
  1. Create comprehensive tests
  2. Add documentation to this guide
  3. Update the main README with the new provider
  4. Follow the existing code patterns
  5. Handle errors gracefully
  6. Support both tool and non-tool usage

Need Help?

API Documentation

Check the complete provider API reference

Discussions

Ask questions and get community help

Report Issues

Found a bug? Let us know