Skip to content

Replace manual Ollama integration with official npm package #245

Closed
@bhouston

Description

@bhouston

Replace manual Ollama integration with official npm package

Description

Currently, our project uses a custom, manually-implemented Ollama LLM provider integration. The Ollama team maintains an official TypeScript/JavaScript library (ollama npm package) that provides a more robust, well-tested, and maintained integration with Ollama's API.

Benefits

  • Maintained by Ollama team: The official library will be kept up-to-date with API changes
  • Type safety: The package includes TypeScript types
  • Reduced maintenance burden: We don't need to maintain our own implementation
  • Enhanced functionality: The official library likely includes more features and better error handling
  • Better tested: The library is used by many projects and likely has better test coverage

Implementation Plan

  1. Add the ollama package as a dependency
  2. Create a new implementation of our LLM provider that uses the official library
  3. Ensure compatibility with our existing provider interface
  4. Update any relevant documentation
  5. Add tests to verify the integration works correctly

Technical Details

  • Current implementation: /packages/agent/src/core/llm/providers/ollama.ts
  • NPM package to use: ollama (latest version)
  • We'll need to map between our message format and the format expected by the library

Acceptance Criteria

  • The new implementation works with the same configuration options as the current one
  • All functionality of the current implementation is preserved
  • Tests pass with the new implementation
  • Documentation is updated to reflect any changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions