hal9

Hal9 — Create and Share Generative Apps

https://github.com/hal9ai/hal9

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary

Keywords

api chatbot framework frontend genapp hal9 langchain llm python webapp
Last synced: 6 months ago · JSON representation

Repository

Hal9 — Create and Share Generative Apps

Basic Info
  • Host: GitHub
  • Owner: hal9ai
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage: https://hal9.com/platform
  • Size: 208 MB
Statistics
  • Stars: 173
  • Watchers: 13
  • Forks: 30
  • Open Issues: 1
  • Releases: 0
Topics
api chatbot framework frontend genapp hal9 langchain llm python webapp
Created over 4 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

Hal9: Create and Share Generative Apps

License: MIT Hal9 PyPi Downloads GitHub star chart

Hal9 is a deployment platform purpose-built for generative AI, enabling you to create and deploy generative (LLMs and diffusers) applications (chatbots, agents, APIs, and apps). Key features: - Flexible: Use any library (LangChain, DSPy), and any model (OpenAI, Llama, Groq, MidJourney). - Intuitive: No need to learn app frameworks (Flask), simply use input() and print(), or write file to disk. - Scalable: Designed to integrate your app with scalable technologies (Docker, Kubernetes, etc). - Powerful: Support for long-running agents, multiple programming languages, complex system dependencies, and running arbitrary code in a secure Kubernetes pods. - Open: The code behind hal9, is also open source and open for contributions under at apps/hal9.

Focus on AI (RAG, fine-tuning, alignment, training) and skip engineering tasks (frontend development, backend integration, deployment, operations).

Getting Started

Create and share a chatbot in seconds as follows:

```bash pip install hal9

hal9 create chatbot hal9 deploy chatbot ```

Notice that deploy needs a HAL9_TOKEN environment variable with an API token you can get from hal9.com/devs. You can use this token to deploy from your local computer, a notebook or automate from GitHub.

bash HAL9_TOKEN=H9YOURTOKEN hal9 deploy chatbot --name my_first_chatbot As easy as that you have created your first chatbot!

alt text

The code inside /chatbot/app.py contains a "Hello World" chatbot that reads the user prompt and echos the result back:

python prompt = input() print(f"Echo: {prompt}")

We designed this package with simplicity in mind, the job of the code is to read input and write output, that's about it. That said, you can create chatbots that use LLMs, generate images, or even use tools that connect to databases, or even build websites and games!

Creation

By default hal9 create defaults to the --template echo template, but you can choose different ones as follows:

bash hal9 create chatbot-openai --template openai hal9 create chatbot-groq --template groq

A template provides ready to use code with specific technologies and use cases. Is very popular to use OpenAI's ChatGPT-like template with --template openai, the code generated will look as follows:

```python import hal9 as h9 from openai import OpenAI

messages = h9.load("messages", []) prompt = h9.input(messages = messages)

completions = OpenAI().chat.completions.create(model = "gpt-4", messages = messages, stream = True)

h9.complete(completions, messages = messages) h9.save("messages", messages, hidden = True) ```

The learn code section explains in detail how this code works, but will provide a quick overview. The hal9 package contains a helper functions to simplify your generative AI code. You can choose to not use hal9 at all and use input() and print() statements yourself, or even sue tools like langchain. The h9.load() and h9.save() functions load and save data across chat sessions, our platform is stateless by default. The h9.input() function is a slim wrapper over input() that also stores the user input in the messages. Then h9.complete() is a helper function to help parse the completion results and save the result in messages. That's about it!

Development

To make changes to your project, open chatbot/ in your IDE and modify chatbot/app.py.

You can then run your project as follows:

bash hal9 run chatbot

If you customized your template with --template make sure to set the correct key, for example, if you are using the OpenAI template use for Linux or macOS:

bash export OPENAI_KEY=YOUR_OPENAI_KEY. For Windows use:

bash set OPENAI_KEY=YOUR_OPENAI_KEY.

For more information on obtaining and using your OpenAI API key, please refer to the OpenAI API Key documentation.

You can then run your application locally with:

bash hal9 run chatbot

This command is just a convenience wrapper to running the code yourself with something like python app.py.

Deployment

The deploy command will prepare for deployment your generative app.

For example, you can prepare deployment as a generative app (Hal9). We have plans to also provide deployment to Docker and the open source community can expand this even further.

bash hal9 deploy chatbot --target hal9

Each command is tasked with preparing the deployment of your project folder. For example, --target docker should create a Dockerfile file that gets this project ready to run in cloud containers.

For personal use, --target hal9 supports a free tier at hal9.com; enterprise support is also available to deploy with --target hal9 --url hal9.yourcompany.com

Contributing

Apart from deploying your apps directly on hal9.com, you can collaborate with our community by contributing new ones to the /apps directory in this repository. Additionally, you can improve Hal9’s core capabilities by refining the code in the apps/hal9 folder.

The hal9 Python package is located in the /python directory, while the documentation website resides under /website. We encourage contributors to focus on enhancing apps first before proposing more complex changes.

Keep in mind that the philosophy of the hal9 package is to remain a lightweight wrapper around input() and print(). The Python community already offers many excellent frameworks, and we aim to encourage their use rather than creating another one.

Owner

  • Name: hal9.ai
  • Login: hal9ai
  • Kind: organization
  • Email: info@hal9.ai
  • Location: Seattle

Create and Share Generative Apps

GitHub Events

Total
  • Issues event: 4
  • Watch event: 34
  • Delete event: 31
  • Issue comment event: 8
  • Push event: 217
  • Pull request review event: 6
  • Pull request review comment event: 5
  • Pull request event: 107
  • Fork event: 4
  • Create event: 35
Last Year
  • Issues event: 4
  • Watch event: 34
  • Delete event: 31
  • Issue comment event: 8
  • Push event: 217
  • Pull request review event: 6
  • Pull request review comment event: 5
  • Pull request event: 107
  • Fork event: 4
  • Create event: 35

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,774
  • Total Committers: 25
  • Avg Commits per committer: 70.96
  • Development Distribution Score (DDS): 0.311
Past Year
  • Commits: 379
  • Committers: 8
  • Avg Commits per committer: 47.375
  • Development Distribution Score (DDS): 0.158
Top Committers
Name Email Commits
Javier Luraschi j****i@g****m 1,223
Anchit Sadana 7****a 124
Greg 8****E 77
Fernando f****a@g****m 75
Kevin Kuo k****o@g****m 72
brenda-lambert 1****t 68
williamorim t****9@g****m 40
Luis Guillen 8****3 24
Diego Arceo d****o@h****i 22
inaki321 9****1 11
Inaki321 i****0@h****i 10
Sigrid Keydana 4****n 7
Brendan 1****n 3
anchit sadana a****a@a****l 3
Jucaski 1****i 2
Ryan 5****e 2
opinon1 o****3@g****m 2
Anchit Sadana a****t@h****i 2
Emiliano Penaloza 5****p 1
Karan Saxena 6****0 1
Mauricio Aguas 1****a 1
Nataliya Stepanova g****a@g****m 1
Yuichiro Tachibana (Tsuchiya) t****t@g****m 1
terezalacerda t****3@u****r 1
slugenj s****j@h****m 1
Committer Domains (Top 20 + Academic)
hal9.ai: 3 usp.br: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 50
  • Total pull requests: 169
  • Average time to close issues: 3 months
  • Average time to close pull requests: 2 days
  • Total issue authors: 11
  • Total pull request authors: 13
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.12
  • Merged pull requests: 137
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 94
  • Average time to close issues: 1 day
  • Average time to close pull requests: 3 days
  • Issue authors: 3
  • Pull request authors: 9
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.12
  • Merged pull requests: 67
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • javierluraschi (23)
  • kevinykuo (15)
  • anchit-sadana (3)
  • Jucaski (2)
  • brenda-lambert (1)
  • Karan0310 (1)
  • paritoshk (1)
  • Fernanda-Avalos (1)
  • FvD (1)
  • LuisGuillen03 (1)
  • romanluras (1)
  • DiegoArceoFelix (1)
Pull Request Authors
  • diegoarceof (52)
  • LuisGuillen03 (48)
  • javierluraschi (31)
  • brenda-lambert (23)
  • skeydan (20)
  • kevinykuo (10)
  • anchit-sadana (7)
  • Karan0310 (5)
  • MauricioAguasFonseca (4)
  • Soopyman (4)
  • Jucaski (3)
  • whitphx (1)
Top Labels
Issue Labels
r (2) client (2) server (2) cli (1) bug (1) good first issue (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 38,850 last-month
    • npm 541 last-month
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 615
  • Total maintainers: 2
npmjs.org: hal9

Hal9: Create and Share Generative Apps

  • License: MIT
  • Latest release: 2.1.2
    published over 1 year ago
  • Versions: 497
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 541 Last month
Rankings
Stargazers count: 4.5%
Forks count: 4.8%
Downloads: 5.6%
Average: 9.2%
Dependent repos count: 10.3%
Dependent packages count: 20.9%
Maintainers (1)
Last synced: 6 months ago
pypi.org: hal9
  • Versions: 118
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 38,850 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 10.5%
Average: 15.9%
Dependent repos count: 30.6%
Maintainers (2)
Last synced: 6 months ago

Dependencies

.github/workflows/js.yaml actions
  • actions/checkout v2 composite
  • actions/setup-node v2 composite
.github/workflows/python.yaml actions
  • JRubics/poetry-publish v1.16 composite
  • actions/checkout v2 composite
.github/workflows/r.yaml actions
  • ATiltedTree/setup-rust v1 composite
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
  • zdurham/s3-upload-github-action master composite
.github/workflows/site.yaml actions
  • LouisBrunner/checks-action v1.1.1 composite
  • actions/checkout v2 composite
  • actions/setup-node v2 composite
  • quarto-dev/quarto-actions/setup v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • zdurham/s3-upload-github-action master composite
js/package.json npm
  • @babel/core ^7.19.6 development
  • @babel/plugin-proposal-nullish-coalescing-operator ^7.18.6 development
  • @babel/plugin-proposal-optional-chaining ^7.18.9 development
  • @babel/plugin-transform-runtime ^7.19.6 development
  • @babel/preset-env ^7.19.4 development
  • babel-loader ^8.2.5 development
  • css-loader ^6.4.0 development
  • html-webpack-plugin ^5.5.0 development
  • http-server ^14.1.1 development
  • raw-loader ^4.0.2 development
  • tape ^5.3.1 development
  • terser-webpack-plugin ^5.3.1 development
  • webpack ^5.70.0 development
  • webpack-bundle-analyzer ^4.5.0 development
  • webpack-cli ^4.9.2 development
  • webpack-dev-server ^4.8.1 development
js/yarn.lock npm
  • 570 dependencies
python/pyproject.toml pypi
  • python >=3.8,<3.9.7 || >3.9.7,<4.0
  • requests ^2.28.2
  • streamlit ^1.17.0
python/hal9/login/frontend/package.json npm
  • typescript ^4.6.2 development
  • @emotion/react ^11.11.1
  • @emotion/styled ^11.11.0
  • @mui/material ^5.13.5
  • @testing-library/jest-dom ^4.2.4
  • @testing-library/react ^9.3.2
  • @testing-library/user-event ^7.1.2
  • @types/chroma-js ^2.4.0
  • @types/jest ^24.0.0
  • @types/node ^12.0.0
  • @types/react ^16.9.0
  • @types/react-dom ^16.9.0
  • chroma-js ^2.4.2
  • react ^16.13.1
  • react-dom ^16.13.1
  • react-scripts 3.4.1
  • streamlit-component-lib-react-hooks ^1.1.0
python/hal9/login/frontend/yarn.lock npm
  • 1574 dependencies