Skip to content

v1.0.0-release

Choose a tag to compare

@lennartpollvogt lennartpollvogt released this 21 Dec 12:36

Release Notes - Version 1.0.0

Major Changes 🚀

This release represents a complete refactoring of ollama-instructor, focusing on better integration with the Ollama client and improved reliability.

Breaking Changes ⚠️

  • Complete rewrite of core classes to inherit directly from Ollama's official Client classes
  • Removed OllamaInstructorClient and OllamaInstructorAsyncClient in favor of OllamaInstructor and OllamaInstructorAsync
  • Removed allow_partial validation feature
  • Removed pydantic_model as parameter
  • Standardized parameter naming. format now take the Pydantic BaseModel instead of parameter pydantic_model
  • Removed option for '' and json for parameter format.
  • Changed method names
  • Removed requirement for explicit async initialization

New Features ✨

  • Direct inheritance from Ollama's Client and AsyncClient classes
  • Improved logging system using Python's built-in logging module
  • Simplified API that matches Ollama's native interface more closely
  • Enhanced retry mechanism using stamina library

API Changes 📝

Old API:

client = OllamaInstructorClient()
response = client.chat_completion(
    pydantic_model=MyModel,
    format='json' # or ''
    # ...
)

New API:

client = OllamaInstructor(enable_logging=True)
response = client.chat_completion(
    format=MyModel,
    # ...
)

Improvements 🔨

  • More robust error handling
  • Better integration with Ollama's native features
  • Cleaner codebase with better type hints
  • Improved streaming functionality
  • More consistent behavior between sync and async implementations

Migration Guide 🔄

To migrate from version 0.5.2:

  1. Update class names to OllamaInstructor or OllamaInstructorAsync
  2. Replace pydantic_model parameter with format
  3. Remove any allow_partial parameters
  4. Update streaming calls to use chat_stream instead of chat_completion_with_stream
  5. Remove async initialization calls (async_init())
  6. If you have used '' for parameter format, replace with Pydantic BaseModel

Please refer to example folder for usage of classes and methods. Click here

Full Changelog: v0.5.2...v1.0.0-release