Skip to main content

LLMPop

The Python library that lets you spin up any LLM with a single function.

Why did we need this library:

  1. Needed a single simple command for any LLM, including the free local LLMs that Ollama offers.
  2. Needed a better way for introducing a code library to a LLM that helps you build code. The llmpop library comes with a machine-readable file that is minimal and sufficent, see LLM_READABLE_GUIDE.md. Add it to your conversation with the coding LLM and it will learn how to build code with llmpop. From a security aspect, this approach is safer then directing your LLM to read someone's entire codebase.

Devs: Lior Gazit, and GPT5

Total hours spent in total on this project so far: 30 hours

Quick run of LLMPop:

Quickest on Colab:
Open In Colab
Or if you want to set it up yourself, pick the free T4 GPU, and copy code over:
Setup:

%pip -q install llmpop 
from llmpop import init_llm, install_ollama_deps
install_ollama_deps()

Run:

# Start with Meta's Llama. If you want a stronger (and bigger) model, try OpenAI's free "gpt-oss:20b":
model = init_llm(model="llama3.2:1b", provider="ollama")
user_prompt = "What OS is better for deploying high scale programs in production? Linux, or Windows?"
print(model.invoke(user_prompt).content)

Examples and tools built with LLMPop

  • ../notebooks/
  • ../examples/

Specifically check out the Colab demo UI notebook under notebooks/multi_llm_webapp.ipynb.
That notebook is a minimal “click, pick, and prompt” UI for LLMPop that lets you select up to four models and compare their replies side by side.
It runs entirely free in your free Google Colab session and auto-handles local models via Ollama (no local installs on your machine).

Features

  • Plug-and-play local LLMs via Ollama—no cloud or API costs required.
  • Easy remote API support (OpenAI, extendable).
  • Unified interface: Seamlessly switch between local and remote models in your code.
  • Resource monitoring: Track CPU, memory, and (optionally) GPU usage while your agents run.

Using LLMPop while coding with an LLM/chatbot

A dedicated, machine readable guide file, is designed to be the one single necessary file for a bot to get to know LLMPop and to build your code with it.
This guide file is LLM_READABLE_GUIDE.md
So, either upload this file to your bot's conversation, or copy the file's content to paste for the bot's context, and it would allow your bot to leverage LLMPop as it builds code.
Note that this machine readable file is super useful in cases that your bot doesn't have access to the internet and can't learn about code libraries it wasn't trained on.
More on this guide file in docs/index.md

Quick start via Colab

Start by running run_ollama_in_colab.ipynb in Colab.

📖 Quick Guides

Codebase Structure

llmpop/
├─ .github/
│ └─ workflows/
│ └─ ci.yml
├─ docs/
│ └─ index.md
├─ examples/
│ ├─ quick_run_llmpop.ipynb
│ ├─ quick_run_llmpop.py
│ └─ run_ollama_in_colab.ipynb
├─ notebooks/
│ └─ multi_llm_webapp.ipynb
├─ src/
│ └─ llmpop/
│ ├─ __init__.py
│ ├─ init_llm.py
│ ├─ monitor_resources.py
│ ├─ py.typed
│ └─ version.py
├─ tests/
│ ├─ test_init_llm.py
│ ├─ test_llm_readable_guide.py
│ └─ test_monitor_resources.py
├─ .gitignore
├─ .pre-commit-config.yaml
├─ CHANGELOG.md
├─ CODE_OF_CONDUCT.md
├─ CONTRIBUTING.md
├─ DEVLOG.md
├─ LICENSE
├─ LLM_READABLE_GUIDE.md
├─ Makefile
├─ MANIFEST.in
├─ pyproject.toml
├─ README.md
├─ requirements-dev.txt
└─ requirements.txt

Where:
• src/ layout is the modern standard for packaging.
• tests/ use pytest; we’ll mock shell/network so CI doesn’t try to actually install/run Ollama.
• examples/ contains notebooks users can run locally/Colab.
• docs/ is optional now; you can add mkdocs later.
• CI runs lint + unit tests on pushes and PRs.
• CHANGELOG follows Keep a Changelog; DEVLOG is your running engineering journal.

Quick setting up

  1. Install from GitHub
    pip -q install llmpop

  2. Try it

    from llmpop import init_llm, start_resource_monitoring
    from langchain_core.prompts import ChatPromptTemplate
    
    model = init_llm(model="gemma3:1b", provider="ollama")
    # Or:
    # os.environ["OPENAI_API_KEY"] = "sk-..."
    # model = init_llm(chosen_llm="gpt-4o", provider="openai")
    
    prompt = ChatPromptTemplate.from_template("Q: {q}\nA:")
    print((prompt | model).invoke({"q":"What is an agent?"}).content)
    
  3. Optional - Resource Monitoring

    monitor_thread = start_resource_monitoring(duration=600, interval=10)
    

Note: LLMPop wraps and depends on third-party open-source libraries (LangChain, Ollama, etc.). These are licensed separately and are not included in LLMPop’s distribution.

Enjoy!

Metadata

Release files for llmpop 0.4.1

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

Source distribution (sdist)

Source distribution for llmpop 0.4.1
File Size Uploaded
llmpop-0.4.1.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llmpop 0.4.1
File Interpreter ABI Platform
llmpop-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / llmpop-0.4.1.tar.gz

Download URL llmpop-0.4.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2d38e3ddc456ea9b9da19f6f82e37314428660524ec632057f4e77dc80525231
BLAKE2b-256 checksum
How to use checksums
6eb5ac2cfee3508e5d354c418fe9b7199a333d4d5d07dfb1bf6988d67548b67c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Release files / llmpop-0.4.1-py3-none-any.whl

Download URL llmpop-0.4.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d2b05667e15d677f6b78bb1fa63bad64d55ba2c6a266aeae737868463ab62c2
BLAKE2b-256 checksum
How to use checksums
2012bd54a56d8b3c8a42be90d5c991e1e4a447523fd1ca84984d21a42239663e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.3

2 release files

0.2.2

2 release files

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