Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

LlamaGram

LlamaGram is an AI agent inspired by OpenClaw (formerly known as MoltBot or ClawdBot), which focuses on document-related tasks.

It runs as a Telegram bot as comes with a CLI interface to set up the necessary environment variables.

Prerequisites

  • Python (if setting up the bot natively, preferably with uv) or Docker (if deploying with Docker)
  • A Telegram Bot Token, in order to connect to Telegram. Follow this guide on how to create your Telegram bot with BotFather.
  • A LlamaCloud API key, in order to give LlamaGram document-processing capabilities. Sign up on LlamaCloud here.
  • An API key for Google, OpenAI or Anthropic (you can choose one among the three or swap between different providers)

Installation

Install the bot natively:

# uv (recommended)
uv tool install llamagram 
# pip
pip install llamagram

Pull the docker image (only works for AMD64-compatible platforms):

docker pull ghcr.io/astrabert/llamagram:main

Setup

Through environment variables, you can customize the setup of LlamaGram:

  • LLAMAGRAM_LLM_PROVIDER: LLM provider (choose between google, anthropic and openai). Default is openai
  • LLAMAGRAM_LLM_MODEL: LLM model (choose among available models). Default is gpt-4.1

You then need to set three required env variables:

  • LLAMAGRAM_LLM_API_KEY: API key for the LLM (you can also use OPENAI_API_KEY, GOOGLE_API_KEY or ANTHROPIC_API_KEY, depending on the provider).
  • TELEGRAM_BOT_TOKEN: token for the Telegram bot
  • LLAMA_CLOUD_API_KEY: API key for LlamaCloud

You can use the setup wizard to configure LlamaGram interactively on the terminal:

llamagram setup --interactive

Or pass options from CLI:

llamagram setup --provider google \
    --model gemini-3-flash-preview \
    --api-key $GOOGLE_API_KEY \
    --llama-cloud-key $LLAMA_CLOUD_API_KEY \
    --telegram-token $TELEGRAM_BOT_TOKEN

This will create a .env file with the necessary variables, which will be loaded by LlamaGram at runtime (make sure not to share it with anyone).

Run

Run LlamaGram as a CLI app:

llamagram run 

You can set the --log-level option, if you wish to have more or less logging.

Run LlamaGram in a Docker container referencing a .env file:

docker run ghcr.io/astrabert/llamagram:main --env-file=".env"

Or, setting env varaibles directly (not recommended):

docker run ghcr.io/astrabert/llamagram:main \
    --env="LLAMAGRAM_LLM_PROVIDER=openai" \
    --env="LLAMAGRAM_LLM_MODEL=gpt-4.1"\
    --env="LLAMAGRAM_LLM_API_KEY=sk-xxx" \
    --env="LLAMA_CLOUD_API_KEY=llx-xxx" \
    --env="TELEGRAM_BOT_TOKEN=tok-xxx"

Use as a Telegram Bot

When on Telegram, you can perform two actions:

  • Sending PDF files, which will be downloaded by the bot
  • Sending text messages, which will work as prompts for the bot to start a new task

With /start command, you will have a welcome message explaining how to use the bot

How LlamaGram Works

LlamaGram is a generalist AI agent based on three main principles:

  • LlamaIndex Agent Workflows: a powerful workflow engine that allows event-driven, stepwise execution of specific tasks and functions. LlamaGram uses a cyclic workflow to go through thinking, tool-calling and observing repeatedly until it produces its final output.
  • Structured outputs: the LLM underlying the agent is forced to produce JSON outputs that comply with certain schemas (a tool call, a thought, an observation...): outputs are produced informed by the previous chat history, and based on context about available tools and specific tasks the agent has to perform.
  • Security by design: the agent does not have access to your real filesystem, but it does have access to a virtualized copy of it provided through AgentFS. PDFs sent over Telegram are also not downloaded into your real filesystem, but written within AgentFS. Files such as .envs or other popular credential files (.npmrc, .pypirc, .netrc) are excluded from the virtual filesystem, and thus unaccessible to the agent. The agent cannot use bash commands (it has access to filesystem-based tools like read/write/edit/grep/glob for AgentFS) to avoid it being able to perform destructive or vulnerable operations.

Here is what happens when you send a prompt to LlamaGram:

Flowchart LlamaGram

Along with the final response, the agent will also send you a report of everything it did during its session as a markdown file (namedd session-<random-id>-report.md).

License

This package is provided under MIT License

Contributing

For contributions, refer to the contributing guide

Metadata

Release files for llamagram 0.1.0b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llamagram 0.1.0b0
File Size Uploaded Provenance Actions
llamagram-0.1.0b0.tar.gz 9.5 kB Without provenance Details for llamagram-0.1.0b0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llamagram 0.1.0b0
File Interpreter ABI Platform Actions
llamagram-0.1.0b0-py3-none-any.whl Python 3 none any Details for llamagram-0.1.0b0-py3-none-any.whl

Total release size: 22.1 kB

Release files / llamagram-0.1.0b0.tar.gz

Download URL llamagram-0.1.0b0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b4ad429781c8632fcdee6fce56188046d2c5f34e2afe0aca7b016b80e2a771a5
BLAKE2b-256 checksum
How to use checksums
5d049e0a51be9533027885a682d006a37150cdc8a5a40f3a4b260b0331a8d877
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llamagram-0.1.0b0-py3-none-any.whl

Download URL llamagram-0.1.0b0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
207f588b85487da1c54b3ea0e9f0affdb38bcb3f16ee4106e3c3bf2d2add6d73
BLAKE2b-256 checksum
How to use checksums
5b6169a8faaf7670606bcaa4704854aa098bc6224f8cfd1c85d5afdcc03973e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llamagram 0.1.0b0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page