Skip to content

Conversation

kilian-hu
Copy link

(Incomplete draft for now until it is decided whether this is preferrable)

This PR converts some of the module constants, which come from the C enums, to proper IntEnums. That arguably makes the API cleaner and easier to use.

Instead of

llama_cpp.Llama("model.gguf", type_k=llama_cpp.GGML_TYPE_Q8_0)

it would be

llama_cpp.Llama("model.gguf", type_k=llama_cpp.GGMLType.Q8_0)

and one gets to enjoy better code completion due to better type hints.

This is a breaking change unless we leave the module constants but set them to the values of the IntEnums. Imo it's fine as long as the version is bumped accordingly so I'd like to just clean this up and not leave the module constants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant