Engines

Engines are the means by which kani interact with language models. As you’ve seen, kani comes with a few engines included:

Model Name

Extra

Capabilities

Engine

All OpenAI Models

openai

🛠️ 🖼

kani.engines.openai.OpenAIEngine

All Anthropic Models

anthropic

🛠️ 🖼

kani.engines.anthropic.AnthropicEngine

All Google AI Models

google

🛠️ 🖼

kani.engines.google.GoogleAIEngine

🤗 transformers[3]

huggingface[1]

(model-specific)

kani.engines.huggingface.HuggingEngine

llama.cpp[2]

cpp

(model-specific)

kani.engines.llamacpp.LlamaCppEngine

vLLM[2]

vllm

(model-specific)

kani.ext.vllm.VLLMEngine, VLLMServerEngine, or VLLMOpenAIEngine

Additional models using the classes above are also supported - see the model zoo for a more comprehensive list of models!

Legend

  • 🛠️: Supports function calling.

  • 🖼: Supports multimodal inputs.

In this section, we’ll cover engine-specific details and features you might want to be aware of when using certain engines.

We’ll also discuss how to implement your own engine to use any language model or API you can think of.

Tip

Built an engine for a model kani doesn’t support yet? kani is OSS and ❤️ PRs with engine implementations for the latest models - see Contributing.