langchain/libs/community/tests/unit_tests
Kate Silverstein 0bc4a9b3fc
community[minor]: Adds Llamafile as an LLM (#17431)
* **Description:** Adds a simple LLM implementation for interacting with
[llamafile](https://github.com/Mozilla-Ocho/llamafile)-based models.
* **Dependencies:** N/A
* **Issue:** N/A

**Detail**
[llamafile](https://github.com/Mozilla-Ocho/llamafile) lets you run LLMs
locally from a single file on most computers without installing any
dependencies.

To use the llamafile LLM implementation, the user needs to:

1. Download a llamafile e.g.
https://huggingface.co/jartine/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/TinyLlama-1.1B-Chat-v1.0.Q5_K_M.llamafile?download=true
2. Make the file executable.
3. Run the llamafile in 'server mode'. (All llamafiles come packaged
with a lightweight server; by default, the server listens at
`http://localhost:8080`.)


```bash
wget https://url/of/model.llamafile
chmod +x model.llamafile
./model.llamafile --server --nobrowser
```

Now, the user can invoke the LLM via the LangChain client:

```python
from langchain_community.llms.llamafile import Llamafile

llm = Llamafile()

llm.invoke("Tell me a joke.")
```
2024-02-14 11:15:24 -08:00
..
agent_toolkits community[minor]: Connery Tool and Toolkit (#14506) 2024-01-29 12:45:03 -08:00
callbacks community[patch]: Release 0.0.14 (#16384) 2024-01-22 08:50:19 -08:00
chat_loaders Restore self message sent before OSX 12 Monterey (#14818) 2024-01-01 16:04:14 -08:00
chat_message_histories community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
chat_models community[minor]: integrate chat models with Yuan2.0 (#16575) 2024-02-13 10:55:14 -08:00
docstore community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
document_loaders Framework for supporting more languages in LanguageParser (#13318) 2024-02-13 08:45:49 -08:00
document_transformers community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
embeddings infra: add print rule to ruff (#16221) 2024-02-09 16:13:30 -08:00
examples community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
graphs community[minor], langchian[minor]: Add Neptune Rdf graph and chain (#16650) 2024-02-12 21:30:20 -08:00
indexes community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
llms community[minor]: Adds Llamafile as an LLM (#17431) 2024-02-14 11:15:24 -08:00
retrievers community: Add you.com utility, update you retriever integration docs (#17014) 2024-02-08 13:47:50 -08:00
storage add mongodb_store (#13801) 2024-02-13 22:33:22 -05:00
tools community[minor]: Connery Tool and Toolkit (#14506) 2024-01-29 12:45:03 -08:00
utilities community: Add you.com utility, update you retriever integration docs (#17014) 2024-02-08 13:47:50 -08:00
utils community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
vectorstores community: add delete method to rocksetdb vectorstore to support recordmanager (#17030) 2024-02-12 19:50:20 -08:00
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
conftest.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_dependencies.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_imports.py infra: Fix test filesystem paths incompatible with windows (#14388) 2023-12-21 13:45:42 -08:00
test_sql_database_schema.py infra: mv SQLDatabase tests to community (#17276) 2024-02-08 17:05:43 -08:00
test_sql_database.py community/SQLDatabase: Generalize and trim software tests (#16659) 2024-02-12 22:58:34 -05:00
test_sqlalchemy.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00