mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-11 15:23:11 +00:00
* Embeddings plugin hook + OpenAI implementation * llm.get_embedding_model(name) function * llm embed command, for returning embeddings or saving them to SQLite * Tests using an EmbedDemo embedding model * llm embed-models list and emeb-models default commands * llm embed-db path and llm embed-db collections commands
20 lines
492 B
Python
20 lines
492 B
Python
from pluggy import HookimplMarker
|
|
from pluggy import HookspecMarker
|
|
|
|
hookspec = HookspecMarker("llm")
|
|
hookimpl = HookimplMarker("llm")
|
|
|
|
|
|
@hookspec
|
|
def register_commands(cli):
|
|
"""Register additional CLI commands, e.g. 'llm mycommand ...'"""
|
|
|
|
|
|
@hookspec
|
|
def register_models(register):
|
|
"Return a list of model instances representing LLM models that can be called"
|
|
|
|
|
|
@hookspec
|
|
def register_embedding_models(register):
|
|
"Return a list of model instances that can be used for embedding"
|