packages feed

llm-simple-0.1.0.1: llm-simple.cabal

cabal-version:      3.0

name:               llm-simple

version:            0.1.0.1

synopsis:
    Multi-provider LLM library with agent tool loops and filesystem tools

-- Note: 'description' is free-form Markdown.
description:
    Experimental Haskell library for talking to LLMs.
    .
    Features multi-provider gateways (OpenAI, Claude, Gemini, Ollama, DeepSeek),
    single-shot text/stream/object generation with model fallbacks, agent tool
    loops, structured output via Autodocodec, JSON model-catalog loading, and
    workspace-scoped filesystem tools.
    .
    Status: early 0.1.x release — APIs may change.

license:            BSD-3-Clause

license-file:       LICENSE

author:             Daniel van den Eijkel

maintainer:         1515314+aische@users.noreply.github.com

category:           AI

homepage:           https://github.com/aische/llm-simple#readme

bug-reports:        https://github.com/aische/llm-simple/issues

build-type:         Simple

extra-doc-files:
    CHANGELOG.md
    Readme.md

extra-source-files:
    model-catalog.json

tested-with:
    GHC ==9.6.7

source-repository head
    type:     git
    location: https://github.com/aische/llm-simple

common opts
    default-language: GHC2021
    default-extensions:
        ConstraintKinds
        DataKinds
        DeriveAnyClass
        DerivingStrategies
        DerivingVia
        LambdaCase
        OverloadedStrings
        OverloadedRecordDot
        DuplicateRecordFields
        NoFieldSelectors
        StrictData
        GADTs
        TypeFamilies
        ScopedTypeVariables
    ghc-options: 
        -Wall 
        -Wunused-imports
        -Werror=missing-fields

library
    import: opts
    exposed-modules:
        LLM
        LLM.Core
        LLM.Core.Abort
        LLM.Core.Types
        LLM.Core.LLMProvider
        LLM.Core.Usage
        LLM.Core.Utils
        LLM.Core.ProviderUtils

        LLM.Providers
        LLM.Providers.Gemini
        LLM.Providers.Claude
        LLM.Providers.OpenAI
        LLM.Providers.Ollama
        LLM.Providers.DeepSeek

        LLM.Agent
        LLM.Agent.Events
        LLM.Agent.Generate
        LLM.Agent.GenerateObject
        LLM.Agent.Tools.HistoryTool
        LLM.Agent.ToolUtils
        LLM.Agent.Types

        LLM.Generate
        LLM.Generate.Generate
        LLM.Generate.GenerateObject
        LLM.Generate.GenerateUtils
        LLM.Generate.ModelConfig
        LLM.Generate.Logger
        LLM.Generate.Types

        LLM.Tools
        LLM.Tools.DirectoryTree
        LLM.Tools.FileInfo
        LLM.Tools.FindFiles
        LLM.Tools.Grep
        LLM.Tools.MultiReplaceInFile
        LLM.Tools.Readfile
        LLM.Tools.ReadFilePaginated
        LLM.Tools.Writefile
        LLM.Tools.ReplaceInFile
        LLM.Tools.Readdir
        LLM.Tools.FsConfig
        LLM.Tools.FsLimits
        LLM.Tools.MoveFile
        LLM.Tools.CopyFile
        LLM.Tools.RemoveFile
        LLM.Tools.CreateDirectory
        LLM.Tools.RemoveDirectory

        LLM.Load
        LLM.Load.LoadGateways
        LLM.Load.ModelCatalog
        LLM.Load.LoadModels
        LLM.Load.Types
        LLM.Load.Utils
        LLM.Load.FsTools

    other-modules:
        LLM.Core.SSE
    hs-source-dirs:     src
    build-depends:
        aeson          >=2.0   && <2.3,
        aeson-pretty   >=0.8   && <0.9,
        autodocodec    >=0.5 && < 0.6,
        autodocodec-schema >=0.2 && <0.3,
        base           ^>=4.18,
        bytestring     >=0.11  && <0.12,
        containers     ^>=0.6.7,
        directory      >=1.3   && <1.4,
        dotenv         >=0.9   && <0.13,
        filepath       >=1.4   && <1.6,
        http-client    >=0.7   && <0.8,
        http-types     >=0.12  && <0.13,
        lens           >=5.3 && <5.4,
        mtl            >=2.3   && <2.4,
        req            >=3.13.4 && <3.14,
        retry          >=0.9   && <0.10,
        text           >=1.2   && <2.2,
        time           >=1.11  && <1.15,
        unordered-containers >=0.2 && < 0.3,
        uuid-types     >=1.0   && <1.1,
        vector         >=0.13  && <0.14,

executable llm-simple
    import: opts
    main-is:          Main.hs
    other-modules:   
    hs-source-dirs:   app
    build-depends:
        aeson          >=2.0   && <2.3,
        autodocodec    >=0.5 && < 0.6,
        autodocodec-schema >=0.2 && <0.3,
        base           ^>=4.18,
        bytestring     >=0.11 && <0.12,
        containers     ^>=0.6.7,
        dotenv         >=0.9   && <0.13,
        directory      >=1.3   && <1.4,
        filepath       >=1.4   && <1.6,
        heptapod       >=1.1   && <1.2,
        llm-simple,
        mtl            >=2.3   && <2.4,
        optparse-applicative >= 0.16 && <0.19,
        retry          >=0.9   && <0.10,
        text           >=1.2   && <2.2

executable record-conversation
    import: opts
    main-is:          RecordConversation.hs
    other-modules:    LLM.TestKit
                        LLM.WeatherTool
    hs-source-dirs:   app
                      test
    build-depends:
        aeson          >=2.0   && <2.3,
        aeson-pretty   >=0.8   && <0.9,
        autodocodec    >=0.5 && < 0.6,
        base           ^>=4.18,
        bytestring     >=0.11 && <0.12,
        containers     ^>=0.6.7,
        dotenv         >=0.9   && <0.13,
        directory      >=1.3   && <1.4,
        filepath       >=1.4   && <1.6,
        heptapod       >=1.1   && <1.2,
        llm-simple,
        optparse-applicative >= 0.16 && <0.19,
        text           >=1.2   && <2.2

test-suite llm-simple-test
    import: opts
    type:               exitcode-stdio-1.0
    main-is:            Spec.hs
    other-modules:      LLM.ClaudeSpec
                        LLM.GeminiSpec
                        LLM.GenericConversationTest
                        LLM.RecordedConversationSpec
                        LLM.OpenAISpec
                        LLM.TypesSpec
                        LLM.ChatSpec
                        LLM.DeepSeekSpec
                        LLM.FsConfigSpec
                        LLM.FsLimitsSpec
                        LLM.FsToolsSpec
                        LLM.LoadSpec
                        LLM.StreamingSpec
                        LLM.HistoryToolSpec
                        LLM.GenerateObjectSpec
                        LLM.ToolUtilsSpec
                        LLM.TestKit
                        LLM.WeatherTool
    hs-source-dirs:     test
    build-depends:
        base           ^>=4.18,
        containers ^>=0.6.7,
        directory      >=1.3   && <1.4,
        filepath       >=1.4   && <1.6,
        temporary      >=1.3   && <1.4,
        text           >=1.2   && <2.2,
        aeson          >=2.0   && <2.3,
        aeson-pretty   >=0.8   && <0.9,
        autodocodec    >=0.5 && < 0.6,
        bytestring     >=0.11  && <0.12,
        hspec          >=2.10  && <2.12,
        heptapod       >=1.1   && <1.2,
        llm-simple,
        retry          >=0.9   && <0.10
    build-tool-depends: hspec-discover:hspec-discover