Git Product home page Git Product logo

lats-for-ollama's Introduction

LATS (Language Agent Tree Search) Implementation for Ollama

LATS (Language Agent Tree Framework) is a MAG framework that originates from https://arxiv.org/abs/2310.04406 . It builds on ToT (Tree of Thoughts) by incorporating a MCTS (Monte Carlo Tree Selection). This tree works differently from BFS or DFS by not solely being bound to the score of a node but also the visits. It selects nodes by looking at their upper confidence bounds which aims to strike a balance between exploration and node score values.

The original paper implementation is here (Though I discovered it after I did this one.): https://github.com/andyz245/LanguageAgentTreeSearch

Here are the sources I used (Except Langchain documentation.): Implementation of LATS: https://github.com/langchain-ai/langgraph/blob/main/examples/lats/lats.ipynb

Calling tools in Langchain: https://medium.com/pythoneers/power-up-ollama-chatbots-with-tools-113ed8229a7a

A primitive and an inefficient implementation of LATS for usage alongside Ollama. It can possibly be extended to support every API out there.

The Reason

The implementation I used as a source is very robust and is very explanative. However, it is only usable for OpenAI API. This is due to how bind_tools works. Both of them work fundementally different in how they call their tools. There exists a solution in the form of Langchain called OllamaFunctions but I found it to be incomplete. Hence I developed this expendable framework to support different APIs.

This implementation is a bit incomplete and inefficient.

Things to look for:

  • There exists no leaf parallelization. (That is each node is done once by once while we can parallelize in expansion doing in batch. This is easy to implement.)
  • I couldn't get OpenAI to work with it however the fix should be easy. (The reason I found is due to message roles.)

lats-for-ollama's People

Contributors

erayyap avatar

Stargazers

Yavuz Alp Sencer ÖZTÜRK avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.