Skip to main content

byLLM : Prompt Less, Smile More!

PyPI version PyPI downloads tests Discord

byLLM is an innovative AI integration framework built for the Jaseci ecosystem, implementing the cutting-edge Meaning Typed Programming (MTP) paradigm. MTP revolutionizes AI integration by embedding prompt engineering directly into code semantics, making AI interactions more natural and maintainable. While primarily designed to complement the Jac programming language, byLLM also provides a powerful Python library interface.

Installation is simple via the Jac plugin installer:

jac install byllm

Basic Example

Consider building an application that translates english to other languages using an LLM. This can be simply built as follows:

def translate_to(language: str, phrase: str) -> str by llm();

with entry {
    output = translate_to(language="Welsh", phrase="Hello world");
    print(output);
}

llm is a built-in name -- no imports needed. By default it uses the model configured in your jac.toml (defaults to gpt-4o-mini). This simple piece of code replaces traditional prompt engineering without introducing additional complexity.

Power of Types with LLMs

Consider a program that detects the personality type of a historical figure from their name. This can be built in a way that LLM picks from an enum and the output strictly adheres to this type.

enum Personality {
    INTROVERT, EXTROVERT, AMBIVERT
}

def get_personality(name: str) -> Personality by llm();

with entry {
    name = "Albert Einstein";
    result = get_personality(name);
    print(f"{result} personality detected for {name}");
}

Similarly, custom types can be used as output types which force the LLM to adhere to the specified type and produce a valid result.

Control! Control! Control!

Even if we are elimination prompt engineering entierly, we allow specific ways to enrich code semantics through docstrings and semstrings.

"""Represents the personal record of a person"""
obj Person {
    has name: str;
    has dob: str;
    has ssn: str;
}

sem Person.name = "Full name of the person";
sem Person.dob = "Date of Birth";
sem Person.ssn = "Last four digits of the Social Security Number of a person";

"""Calculate eligibility for various services based on person's data."""
def check_eligibility(person: Person, service_type: str) -> bool by llm();

Docstrings naturally enhance the semantics of their associated code constructs, while the sem keyword provides an elegant way to enrich the meaning of class attributes and function arguments. Our research shows these concise semantic strings are more effective than traditional multi-line prompts.

Configuration

Project-wide Configuration (jac.toml)

Configure byLLM behavior globally using jac.toml:

[plugins.byllm]
system_prompt = "You are a helpful assistant..."

[plugins.byllm.model]
default_model = "gpt-4o-mini"

[plugins.byllm.call_params]
temperature = 0.7

This enables centralized control over:

  • System prompts across all LLM calls
  • Default model selection
  • Common parameters like temperature

Custom Model Endpoints

Connect to custom or self-hosted models:

import from byllm.lib { Model }

glob llm = Model(
    model_name="custom-model",
    config={
        "api_base": "https://your-endpoint.com/v1/chat/completions",
        "api_key": "your_key",
        "http_client": True
    }
);

How well does byLLM work?

byLLM is built using the underline priciple of Meaning Typed Programming and we shown our evaluation data compared with two such AI integration frameworks for python, such as DSPy and LMQL. We show significant performance gain against LMQL while allowing on par or better performance to DSPy, while reducing devloper complexity upto 10x.

Full Documentation: Jac byLLM Documentation

Complete Examples: Jac Examples Gallery

Research: The research journey of MTP is available on ACM Digital Library and published at OOPSLA 2025.

Contributing

We welcome contributions to byLLM! Whether you're fixing bugs, improving documentation, or adding new features, your help is appreciated.

Areas we actively seek contributions:

  • Bug fixes and improvements
  • Documentation enhancements
  • New examples and tutorials
  • Test cases and benchmarks

Please see our Contributing Guide for detailed instructions.

If you find a bug or have a feature request, please open an issue.

Community

Join our vibrant community:

License

This project is licensed under the MIT License.

Third-Party Dependencies

byLLM integrates with various LLM providers (OpenAI, Anthropic, Google, etc.) through LiteLLM.

Cite our research

Jayanaka L. Dantanarayana, Yiping Kang, Kugesan Sivasothynathan, Christopher Clarke, Baichuan Li, Savini Kashmira, Krisztian Flautner, Lingjia Tang, and Jason Mars. 2025. MTP: A Meaning-Typed Language Ab- straction for AI-Integrated Programming. Proc. ACM Program. Lang. 9, OOPSLA2, Article 314 (October 2025), 29 pages. https://doi.org/10.1145/3763092

Jaseci Contributors

Metadata

Release files for byllm 0.6.19

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

Source distribution (sdist)

Source distribution for byllm 0.6.19
File Size Uploaded
byllm-0.6.19.tar.gz 82.9 kB Details

Built distribution (wheel)

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

Total release size: 401.8 kB

Release files / byllm-0.6.19.tar.gz

Download URL byllm-0.6.19.tar.gz
Size 82.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9fca3c7c4bb4d660b09761db7165d150fa655c94942b513c127f4ad4e651160d
BLAKE2b-256 checksum
How to use checksums
21ef04ee64613130af3c152e1bac1dcfd3e225c9157410d93346b0f1b1ddeaf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / byllm-0.6.19-py3-none-any.whl

Download URL byllm-0.6.19-py3-none-any.whl
Size 318.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4728bf63a32907555c6953b945c8f7f4fbc0233d7620800f1aad7dccf9ae84bf
BLAKE2b-256 checksum
How to use checksums
80fa2fb383ef7c421b0542583d3a5ef1d47c15aa2c6120f07c57534e76e5692b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.6.19 This release

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.13

1 release file

0.6.12

1 release file

0.6.11

1 release file

0.6.10

1 release file

0.6.9

1 release file

0.6.8

1 release file

0.6.7

1 release file

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.21

2 release files

0.4.20

2 release files

0.4.19

2 release files

0.4.17

2 release files

0.4.16

2 release files

0.4.15

2 release files

0.4.14

2 release files

0.4.13

2 release files

0.4.12

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

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