Hal9: Build AI Apps in Python
Hal9 Platform is transitioning to Cloudish. Hal9 Platform is moving to Cloudish, the cloud AI agents sign up for and deploy to on their own. You can deploy Python apps to Cloudish today; the legacy platform is read-only while the transition continues. The
hal9Python package remains supported: keep writing your app in Python withinput()andprint()(or thehal9helpers), then ask an AI coding agent such as Claude Code, Codex, or Cursor to build a chat interface and deploy it to Cloudish.
Hal9 is a Seattle AI company. It builds Cloudish, a cloud where AI agents create their own API key, submit a Dockerfile or container image, and get a live HTTPS URL, with no local Docker and no signup form. This repository contains the open-source hal9 Python package, its JavaScript counterpart, and example apps.
The hal9 Python package is 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()andprint(), or write files to disk. - Scalable: Your AI can be packaged as a container and deployed to Cloudish or any other container platform.
- Powerful: Support for long-running agents, multiple programming languages, complex system dependencies, and running arbitrary code in secure containers.
- Open: The code behind Hal9 is open source and open for contributions under apps/hal9.
Focus on AI (RAG, fine-tuning, alignment, training) and let your coding agent handle the frontend, backend integration, deployment, and operations.
Create and run a chatbot locally in seconds:
pip install hal9
hal9 create chatbot
hal9 run chatbotThe code inside chatbot/app.py contains a "Hello World" chatbot that reads the user prompt and echoes the result back:
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, use tools that connect to databases, or even build websites and games.
By default hal9 create uses the --template echo template, but you can choose different ones as follows:
hal9 create chatbot-openai --template openai
hal9 create chatbot-groq --template groqA template provides ready-to-use code for specific technologies and use cases. It is very popular to use OpenAI's ChatGPT-like template with --template openai; the generated code looks as follows:
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 here is a quick overview. The hal9 package contains helper functions to simplify your generative AI code. You can choose not to use hal9 at all and use input() and print() yourself, or even use tools like langchain. The h9.load() and h9.save() functions load and save data across chat sessions, since your application process is stateless by default. The h9.input() function is a slim wrapper over input() that also stores the user input in messages. Then h9.complete() is a helper function to parse the completion results and save the result in messages. That's about it!
To make changes to your project, open chatbot/ in your IDE and modify chatbot/app.py.
You can then run your project as follows:
hal9 run chatbotIf you customized your template with --template, make sure to set the correct key. For example, if you are using the OpenAI template on Linux or macOS:
export OPENAI_API_KEY=YOUR_OPENAI_KEYFor Windows use:
set OPENAI_API_KEY=YOUR_OPENAI_KEYFor more information on obtaining and using your OpenAI API key, please refer to the OpenAI API Key documentation.
This command is just a convenience wrapper around running the code yourself with python app.py.
Hal9 Platform used to package a Python app with a chat frontend and host it on hal9.com. It is transitioning to Cloudish, and the legacy platform is read-only while that transition continues. Cloudish runs containers, so your app needs its own web interface and a Dockerfile; Cloudish builds the container server-side and gives it a live HTTPS URL.
You don't have to write that interface yourself. Open your project in Claude Code, Codex, Cursor, or another coding agent and ask:
This is a Hal9 app.
app.pyreads user messages from stdin withinput()/hal9.input()and writes replies to stdout withprint()/hal9.complete(). Build a chat web interface and a small server that runsapp.pyfor each message and streams its output. Add aDockerfilethat listens on port 8080, then deploy it to cloudish.ai using https://cloudish.ai/skill.md as the deployment guide.
The agent will:
- Build a chat frontend and a server that bridges HTTP requests to your program's stdin/stdout.
- Add a
Dockerfilewith your dependencies and a listening port. - Create a Cloudish key, deploy the container, and return the HTTPS URL.
Cloudish is agent-first: the agent can create a key and deploy without a signup form, and it builds the image server-side so no local Docker is required. New keys include a small starting credit (subject to availability); usage is prepaid and metered per second. If your app stores data with h9.save() / h9.load(), ask the agent to attach a Cloudish volume and keep the .storage folder on it so conversations survive restarts.
See Deployment in the docs for more detail.
The legacy Hal9 Platform is read-only while it transitions to Cloudish. It no longer accepts new deployments, so hal9 deploy and h9.deploy() cannot publish apps there. Deploy to Cloudish instead.
- Apps: Ask your coding agent to add a chat frontend, a server, and a
Dockerfile, then deploy the container to Cloudish. The Python logic inapp.pystays the same. - Deployment:
hal9 deployno longer works because the legacy platform is read-only. Cloudish uses its own API key, which your agent can create automatically. - Data: Hal9 Platform provided storage for
h9.save()/h9.load(). On Cloudish, attach a persistent volume and keep the.storagefolder on it. - Interfaces: Hal9 Platform provided the chat UI. With Cloudish, the interface is part of your app, which is why the agent builds it for you.
You can deploy your apps to Cloudish, and you can collaborate with our community by contributing new examples to the /apps directory in this repository.
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.