Skip to main content

Add your description here

Project description

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.0

✨ 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 ✅✅✅

✅ Recommended EasyLLM Style

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."

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_easy_llm-0.1.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_easy_llm-0.1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file python_easy_llm-0.1.1.tar.gz.

File metadata

  • Download URL: python_easy_llm-0.1.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for python_easy_llm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8b16e18fd54ed279079e44e26f25abfac598df7a9d69d67a158ec16f4cadc6bc
MD5 a45701e80e82f318ccdaeba1deb7ea1f
BLAKE2b-256 57b530a710f9248e79903aa3c1c551ec37e3c72c6b3d3c6ed15ff96f809711f1

See more details on using hashes here.

File details

Details for the file python_easy_llm-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_easy_llm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5550b728af4a05f86950b92b457c8f369f70c4417a9f391b4efd0f845d1e5227
MD5 b584107292ea471d60c2e7aed4aa2cd8
BLAKE2b-256 1d976bca1e0dbf9f0ef1eebfc16a34ccf27b51f5bf861bde1100ddce9f21efd0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page