MIT licensed by Tushar Adhatrao
Maintained by [email protected]
This version can be pinned in stack with:langchain-hs-ollama-0.0.6.2@sha256:1d4ed7328c417866c2dc2143c5e993ae6c3f06bfe6734e1ed8e44a55bee1d136,2351

Module documentation for 0.0.6.2

langchain-hs-ollama

Ollama ChatModel provider and embeddings for langchain-hs.

Provides Langchain.Provider.Ollama and Langchain.Embeddings.Ollama without pulling in OpenAI or Gemini dependencies.

Installation

# stack.yaml extra-deps
- langchain-hs-ollama-0.0.6.2
# package.yaml / .cabal
dependencies:
  - langchain-hs-ollama

Usage

import Langchain.Provider.Ollama
import Control.Monad.Except (runExceptT)

main :: IO ()
main = do
  model <- newOllama "llama3" defaultClientConfig
  let cfg = withOptions (defaultOptions {optTemperature = Just 0.7}) defaultOllamaConfig
  res   <- runExceptT $ invoke model [userMessage "Hello"] (Just cfg)
  print res

Changes

Changelog for langchain-hs-ollama

0.0.6.2 - 2026-11-14

  • Coordinated monorepo release alignment to 0.0.6.2.
  • Forward streamed tool calls from ollama-haskell in ChatModel.stream as LLMChunk "" (Just toolCall).
  • Updated langchain-hs-core dependency bound to >= 0.0.6.2 && < 0.0.7.

0.0.6.1 - 2026-10-25

  • Upgrade dependency ollama-haskell to >= 0.4.2.0 && < 0.5.
  • Update message and tool call conversions for ollama-haskell-0.4.2.0.

0.0.6.0 - 2026-10-02

  • Initial release. Split from the monolithic langchain-hs package.
  • Provides Langchain.Provider.Ollama and Langchain.Embeddings.Ollama.