An open API service indexing awesome lists of open source software.

https://github.com/tinybiggames/phippsai

Your Personal AI Butler
https://github.com/tinybiggames/phippsai

library llm-inference local-inference ollama ollama-api win64 windows-10 windows-11

Last synced: 10 months ago
JSON representation

Your Personal AI Butler

Awesome Lists containing this project

README

          

![PhippsAI](media/phippsai.png)
[![Chat on Discord](https://img.shields.io/discord/754884471324672040?style=for-the-badge)](https://discord.gg/tPWjMwK)
[![Follow on Bluesky](https://img.shields.io/badge/Bluesky-tinyBigGAMES-blue?style=for-the-badge&logo=bluesky)](https://bsky.app/profile/tinybiggames.com)

PhippsAI is an **๐Ÿงช experimental** project that integrates **๐Ÿ’ป local generative AI** with real-time **๐ŸŒ web search capabilities** using function calling. The system is powered by **๐Ÿง  DeepSeek R1**, running locally via **llama.cpp**, and employs **๐Ÿ” Tavily** for live web searches.

## ๐Ÿš€ Features
- ๐Ÿ  **Local AI Model**: Runs **DeepSeek R1 Distill Llama 8B**, a distilled version of **Llama 3.1 8B**.
- โšก **Function Calling Support**: Allows the model to trigger web search actions when necessary.
- ๐ŸŒ **Real-Time Web Search**: Uses **Tavily** to fetch up-to-date information dynamically.
- ๐ŸŽ๏ธ **Optimized for Efficiency**: Leveraging **llama.cpp**, enabling fast and efficient execution on local hardware.
- ๐ŸŒ **Cross-Language Support**: Built as a **Win64 Unicode DLL**, making it compatible with any language via DLL bindings, running Windows 10 or higher.
- ๐ŸŽฏ **Developed in Delphi**: Requires Delphi 12.2 for building the DLL, but a prebuilt, ready-to-use DLL is included in the repository.

## ๐Ÿ“ฅ Model Requirements

### ๐Ÿ“Œ Required Model
To run **PhippsAI**, you must use the following model:

- **๐Ÿง  Model Name**: `deepseek-r1-distill-llama-8b-abliterated-q4_k_m.gguf`
- ๐Ÿ“ฅ **Download Link**: [๐Ÿ”— Hugging Face Repository](https://huggingface.co/tinybiggames/DeepSeek-R1-Distill-Llama-8B-abliterated-Q4_K_M-GGUF/resolve/main/deepseek-r1-distill-llama-8b-abliterated-q4_k_m.gguf?download=true)

### ๐Ÿ“ Model Overview
- This model is a **distilled** version of **Llama 3.1 8B**.
- It supports **๐Ÿ”ง function calling**, which is necessary for web search functionality.

## ๐ŸŒ Web Search Integration

### ๐Ÿ› ๏ธ Implemented Tool: Web Search
- The AI model can **โš™๏ธ call functions** to perform real-time web searches as needed.
- The web search tool is powered by **Tavily**, enabling quick and accurate online information retrieval.

### โš™๏ธ Setting Up Web Search
To enable **๐ŸŒ web search capabilities**, you need to set up a **Tavily** account:
- ๐Ÿ“ Sign up for a free **Tavily** account: [๐Ÿ”— Tavily Website](https://tavily.com/)
- ๐Ÿ”‘ Obtain your **Tavily API key** after signing up.

### ๐Ÿ”ง Setting the API Key
There are two ways to provide the **Tavily API key** to PhippsAI:

#### **๐Ÿ› ๏ธ Option 1: Set API Key in Code**
Call the following function:
```delphi
phSetSearchAPIKey('YOUR_TAVILY_APIKEY')
```

#### **๐ŸŒ Option 2: Use an Environment Variable**
Set an **environment variable** for your API key:
- Create a new environment variable named **`TAVILY_API_KEY`**.
- Assign it your **Tavily API key**.

If the API key is not manually provided, the system will automatically attempt to retrieve it from the environment variable.

## ๐Ÿš€ Getting Started

### ๐Ÿ“ฅ 1. Download PhippsAI
Download **PhippsAI** from the **GitHub repo**:
- [Download PhippsAI](https://github.com/tinyBigGAMES/PhippsAI/archive/refs/heads/main.zip)
- Add `PhippsAI` bindings to your project from the `lib` folder.

### ๐Ÿ“ฅ 2. Download the Model
Download the **DeepSeek R1** model file from the provided **Hugging Face** link and store it in the appropriate directory.
๐Ÿ“‚ The examples use `C:/LLM/GGUF`.

### ๐Ÿ”ง 3. Configure Web Search
If you want to enable **real-time web search**, set up your **Tavily API key** as described above.
โœ… We recommend the environment variable option.

### โ–ถ๏ธ 4. Run the Examples
Run the provided examples to see **PhippsAI** in action!

**NOTE:** This project is experimental and still a work in progress. There are known issues with function calling. At times, the model may attempt to reason out of a function call when it should simply execute it. Occasionally, it successfully calls the web search but displays the results with formatting errors. These and other similar edge cases are ongoing issues that still need to be addressed.

## ๐Ÿ“บ Media

https://github.com/user-attachments/assets/9f7a8fc5-8888-4e82-ad73-d7239993c245

## ๐Ÿ› ๏ธ Support and Resources

- ๐Ÿž **Report issues** via the [Issue Tracker](https://github.com/tinyBigGAMES/PhippsAI/issues).
- ๐Ÿ’ฌ **Engage in discussions** on the [Forum](https://github.com/tinyBigGAMES/PhippsAI/discussions) and [Discord](https://discord.gg/tPWjMwK).
- ๐Ÿ“š **Learn more** at [Learn Delphi](https://learndelphi.org).

## ๐Ÿค Contributing

Contributions to **โœจ PhippsAI** are highly encouraged! ๐ŸŒŸ
- ๐Ÿ› **Report Issues:** Submit issues if you encounter bugs or need help.
- ๐Ÿ’ก **Suggest Features:** Share your ideas to make **PhippsAI** even better.
- ๐Ÿ”ง **Create Pull Requests:** Help expand the capabilities and robustness of the library.

Your contributions make a difference! ๐Ÿ™Œโœจ

#### Contributors ๐Ÿ‘ฅ๐Ÿค



## ๐Ÿ“œ Licensing

**PhippsAI** is distributed under the **๐Ÿ†“ BSD-3-Clause License**, allowing for redistribution and use in both source and binary forms, with or without modification, under specific conditions.
See the [๐Ÿ“œ LICENSE](https://github.com/tinyBigGAMES/PhippsAI?tab=BSD-3-Clause-1-ov-file#BSD-3-Clause-1-ov-file) file for more details.

---

๐Ÿฐ **Enhance your experience with PhippsAI โ€“ Your AI Butler, always at your service ๐Ÿค–โ˜•.**


Delphi




Made with โค๏ธ in Delphi