FingerLiu / hal-9100

HAL-9100 allows you to build AI assistants within your own applications with your own models. 100% private, 75% Cheaper & 23x Faster Assistants. Using OpenAI SDK. Written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hal-9100

πŸ€– HAL-9100

Build Powerful AI Assistants In-House, On Your Terms. Using OpenAI SDK. For production.

100% Private, 75% Cheaper & 23x Faster Assistants.

Open in GitHub Codespaces
Join Discord


πŸ–ΌοΈ Infra ✨ Feature? β€οΈβ€πŸ©Ή Bug? πŸ“ž Help?


⭐️ Latest News

✨ Key Features

  • Code Interpreter: Generate and runs Python code in a sandboxed environment autonomously. (beta)
  • Knowledge Retrieval: Retrieves external knowledge or documents autonomously.
  • Function Calling: Defines and executes custom functions autonomously.
  • Actions: Execute requests to external APIs autonomously.
  • Files: Supports a range of file formats.
  • Production-ready: scalable, observability (metrics, errors, traces, logs)

πŸ˜ƒ Who is it for?

  • You operate on a large scale and want to reduce your costs
  • You want to increase your speed
  • You want to increase customization (e.g. use your own models, extend the API, etc.)
  • You work in a data-sensitive environment (healthcare, IoT, military, law, etc.)
  • Your product does have poor internet access (military, IoT, extreme environment, etc.)

πŸ“ Principles

hal-9100

HAL-9100 is in continuous development, with the aim of always offering better infrastructure for Edge LLMs. To achieve this, it is based on several principles that define its functionality and scope.

Less prompt is more

As few prompts as possible should be hard-coded into the infrastructure, just enough to bridge the gap between Software 1.0 and Software 3.0 and give the client as much control as possible on the prompts.

Edge-first

HAL-9100 does not require internet access by focusing on open source LLMs. Which means you own your data and your models. It runs on a Raspberry PI (LLM included).

OpenAI-compatible

OpenAI spent a large amount of the best brain power to design this API, which makes it an incredible experience for developers.

Reliable and deterministic

HAL-9100 focus on reliability and being as deterministic as possible by default. That's why everything has to be tested and benchmarked.

Flexible

A minimal number of hard-coded prompts and behaviors, a wide range of models, infrastructure components and deployment options and it play well with the open-source ecosystem, while only integrating projects that have stood the test of time.

Quickstart

Start server:

docker compose -f docker/docker-compose.yml up

# in another terminal
make server

# in another terminal
maker consumer

Start client:

Since it's compatible with OpenAI Assistants API, this is how you would integrate the client side:

hal-9100

Get started in less than a minute through GitHub Codespaces:

Open in GitHub Codespaces

Or:

git clone https://github.com/stellar-amenities/hal-9100
cd hal-9100
cp .env.example .env

To get started quickly, let's use Perplexity API. Get an API key from Perplexity. You can get it here. Replace in .env the MODEL_API_KEY with your API key

Install OpenAI SDK: npm i openai

Start the infra:

docker compose --profile api -f docker/docker-compose.yml up -d

Run the quickstart:

node examples/quickstart.js

πŸš€ Deployment

Please follow this documentation.

πŸ€” FAQ

Which LLM API can I use?

Examples of LLM APIs that does not support OpenAI API-like, that you can't use:

  • ollama (but any contribution to make it compatible would be appreciated)
  • llama.cpp server example

Examples of LLM APIs that does support OpenAI API-like, that you can use:

What's the difference with LangChain? You can write AI products in 50 lines of code instead of 5000, and avoid being dependent on a feature-creep project.
Are you related to OpenAI? No.
I don't use Assistants API. Can I use this? We recommend switching to the Assistants API for a more streamlined experience, allowing you to focus more on your product than on infrastructure.
Does the Assistants API support audio and images? Images soon, working on it.

About

HAL-9100 allows you to build AI assistants within your own applications with your own models. 100% private, 75% Cheaper & 23x Faster Assistants. Using OpenAI SDK. Written in Rust

License:MIT License


Languages

Language:Rust 98.8%Language:Makefile 0.6%Language:Shell 0.3%Language:Dockerfile 0.3%