Skip to main content

EasyLLM

中文文档 🇨🇳
PyPI License: MIT Stars

EasyLLM is a lightweight LLM wrapper library that helps you interact with large language models in the most intuitive and natural way.
Whether it's prompt engineering, structured output, or multi-vendor model access, EasyLLM is designed to make development simpler and more enjoyable.


🚀 Features

  • 🔁 Unified Interface: Supports multiple model providers (OpenAI, DeepSeek, Moonshot, Kimi, Claude, etc.) with consistent API usage.
  • 🧠 Prompt-as-Content: Write prompts in Markdown + Jinja2 instead of verbose messages dictionaries.
  • 🧩 Structured Output Support: Enable JSON-mode to receive structured responses from models — great for product integration.
  • 🛠️ Easy Integration: Minimal dependencies, easily embedded into any Python project with no learning curve.

📦 Installation

pip install python-easy-llm==0.1.2

✨ Quick Example: Calling an LLM

from easyllm import LLM
import os

llm = LLM(
    model_name="deepseek-chat",
    model_provider="deepseek",
    api_key=os.environ["DEEPSEEK_API_KEY"]
)

response = llm("What is 1 + 1?")
print(response)

📄 Example: Structured Output + Jinja2 Prompt Template

from jinja2 import Template
from easyllm import LLM
import os

llm = LLM(
    model_name="deepseek-chat",
    model_provider="deepseek",
    api_key=os.environ["DEEPSEEK_API_KEY"]
)

prompt_t = Template("""
# System
You are a {{ domain }} assistant. Based on the user's interests and skills, recommend a suitable career path. Please respond in JSON format:
{
  "recommended_job": string,
  "reason": string
}

# User
I'm interested in tech, enjoy programming, and I'm introverted with average communication skills. What job is a good fit for me?
""")

prompt = prompt_t.render(domain="career recommendation")
response = llm(prompt, json_mode=True)
print(response)

Sample output:

{
  "recommended_job": "Backend Developer",
  "reason": "You enjoy programming, have strong technical interests, and prefer limited interpersonal interaction. Backend development is a great fit for focusing on system logic and architecture."
}

🔄 Prompt Style Comparison

Framework Prompt Structure Complexity Readability
OpenAI SDK messages=[...] ⭐⭐ ❌
LangChain ChatPromptTemplate ⭐⭐⭐⭐ ⭐⭐
EasyLLM Markdown + Jinja2 ⭐ ✅✅✅
from jinja2 import Template

prompt_t = Template("""
# System
You are a {{ domain }} assistant who helps users solve their problems.
# User
What is 1 + 1?
""")

response = llm(prompt_t.render(domain="math"))
print(response)

🔧 Roadmap / TODO

  • Built-in prompt versioning and template storage
  • Visual Prompt Editor (Prompt Studio)
  • Additional providers (e.g., Tongyi, Zhipu AI, Baichuan)

❤️ Contributing

We welcome contributions from the community! You can:

  • Open issues or submit PRs
  • Suggest new prompt templates
  • Help improve the documentation or examples

👉 Don’t forget to ⭐️ the repo to support its growth!


📄 License

MIT License © 2025 [Chunyou Peng]


📬 Contact


⭐️ Project Vision

"We aim to make EasyLLM the most intuitive tool for building Chinese LLM applications — writing prompts should feel as natural as writing Markdown."

Metadata

Release files for python-easy-llm 0.1.2

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

Source distribution (sdist)

Source distribution for python-easy-llm 0.1.2
File Size Uploaded Provenance Actions
python_easy_llm-0.1.2.tar.gz 8.0 kB Without provenance Details for python_easy_llm-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-easy-llm 0.1.2
File Interpreter ABI Platform Actions
python_easy_llm-0.1.2-py3-none-any.whl Python 3 none any Details for python_easy_llm-0.1.2-py3-none-any.whl

Total release size: 15.9 kB

Release files / python_easy_llm-0.1.2.tar.gz

Download URL python_easy_llm-0.1.2.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cb3fcf51956b3117b0493b4e1bccf1e3de72eb88bb04fc30336de6d214528b0b
BLAKE2b-256 checksum
How to use checksums
72ec6213f251a6b543f9e9ca2a93d094e6602199c84f890d17fc31f7f42b5b96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / python_easy_llm-0.1.2-py3-none-any.whl

Download URL python_easy_llm-0.1.2-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
274c7a330f5097e1289be35df962b9d9abcf640dd92c20f4b457a3b9aaebbfda
BLAKE2b-256 checksum
How to use checksums
507e467dd4a583e0589ee41bcccc19d90f15505e05e11c3fedf022a718a407f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for python-easy-llm 0.1.2

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.

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