Giter Site home page Giter Site logo

1worldcapture / callama Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unclecode/callama

0.0 0.0 0.0 1.91 MB

Democratizing Function Calling Capabilities for Open-Source Language Models

License: Apache License 2.0

Python 86.99% Jinja 13.01%

callama's Introduction

๐Ÿ“ž๐Ÿฆ™ CaLLama: Hola "Function" are you there?

CaLLama

This repository is dedicated to advancing the "function-call" features for open-source large language models (LLMs). We believe that the future of AI, specifically AI agents, depends on proper function-calling capabilities. While proprietary models like OpenAI's have these features, it is crucial for the open-source community to have access to high-quality function-calling abilities to democratize AI.

Recently, Facebook released LLaMA3, perhaps the best open-source LLM available. We have fine-tuned and created a version of LLaMA3 that natively supports function calls.

๐ŸŽฏ Solutions

We are focusing on two directions:

  1. We are developing a cool library focused on function-call to build a uniform way of working with function calls (tool calls) for all LLMs. This library will be released in its first version soon.
  2. Fine-tuning small models specifically for function calling, which has already been done for Llama 3 and Tiny Llama.

Usage Methods ๐Ÿ› ๏ธ

Model in HuggingFace

๐Ÿ–ฅ๏ธ Colab

  1. To know how to run using helper class, check this colab Open In Colab
  2. For a more detailed experience, check out the Open In Colab
  3. To use GGFU version, check out the Open In Colab

๐Ÿ› ๏ธ Usage Locally

To use the models in this repository, follow these steps:

  1. Clone the repository:
git clone https://github.com/unclecode/fllm.git
  1. Create a virtual environment and activate it:
conda create --name env python=3.10
conda activate env
  1. Install PyTorch if you haven't already:
conda install pytorch-cuda=<12.1/11.8> pytorch cudatoolkit xformers -c pytorch -c nvidia -c xformers
  1. Install the required dependencies:
python setup.py
  1. Add your HuggingFace token in ".env.text", and then rename the file to ".env".

  2. Run the example code in the examples folder to see the models in action.

You can also refer to the callama.py file in the llms folder to see the LLM chat template.

๐Ÿฆ™ Using the ollama

Steps to run the example:

  1. Make sure Ollama is installed, and ollama server is running.
  2. Pull the model from the ollaama hub.
ollama pull unclecode/llama3callama
ollama pull unclecode/tinycallama
  1. Make sure to check the ollama example here

Link to models:

โœ… Features TODO List

  • Single function detection
  • Support for various model sizes and quantization levels
  • Available as a LoRA adapter that can be merged with many models
  • Multi-function detection
  • Function binding, allowing the model to detect the order of execution and bind the output of one function to another
  • Fine-tuning models with less than 1B parameters for efficient function calling

๐Ÿค— Models

The following models are available on Hugging Face:

๐Ÿ“Š Dataset

The models were fine-tuned using a modified version of the ilacai/glaive-function-calling-v2-sharegpt dataset, which can be found at unclecode/glaive-function-calling-llama3.

๐Ÿค Contributing

We welcome contributions from the community. If you are interested in joining this project or have any questions, please open an issue in this repository.

Twitter (X): https://x.com/unclecode

๐Ÿ“œ License

These models are released under the Apache 2.0 license.

callama's People

Contributors

unclecode 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.