You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/langchain_community/llms
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.")
```
7 months ago
..
grammars community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
__init__.py community: Add Baichuan LLM to community (#16724) 8 months ago
ai21.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
aleph_alpha.py infra: add print rule to ruff (#16221) 8 months ago
amazon_api_gateway.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
anthropic.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
anyscale.py community[patch]: Modify LLMs/Anyscale work with OpenAI API v1 (#14206) 8 months ago
aphrodite.py community[minor]: Add Aphrodite Engine support (#14759) 9 months ago
arcee.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
aviary.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
azureml_endpoint.py community[patch]: chat model mypy fixes (#17061) 8 months ago
baichuan.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
baidu_qianfan_endpoint.py community:qianfan endpoint support init params & remove useless params definietion (#15381) 9 months ago
bananadev.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
baseten.py community: refactor Baseten integration with new API endpoints & docs (#15017) 9 months ago
beam.py infra: add print rule to ruff (#16221) 8 months ago
bedrock.py community[patch]: Fix pydantic ForwardRef error in BedrockBase (#17416) 7 months ago
bittensor.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
cerebriumai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
chatglm.py <langchain_community\llms\chatglm.py>: <Correcting "history"> (#16729) 8 months ago
chatglm3.py community: Add ChatGLM3 (#15265) 8 months ago
clarifai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
cloudflare_workersai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
cohere.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
ctransformers.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
ctranslate2.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
databricks.py community[patch]: Support SerDe transform functions in Databricks LLM (#16752) 8 months ago
deepinfra.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
deepsparse.py infra: add print rule to ruff (#16221) 8 months ago
edenai.py community: replace deprecated davinci models (#14860) 9 months ago
fake.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
fireworks.py docs: docstrings `langchain_community` update (#14889) 9 months ago
forefrontai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
gigachat.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
google_palm.py community[patch]: more deprecations (#15782) 9 months ago
gooseai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
gpt4all.py community[patch]: Enable streaming for GPT4all (#16392) 8 months ago
gradient_ai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
huggingface_endpoint.py community[patch]: added 'conversational' as a valid task for hugginface endopoint models (#15761) 8 months ago
huggingface_hub.py community[patch]: Fix the _call of HuggingFaceHub (#16891) 8 months ago
huggingface_pipeline.py community: add runtime kwargs to HuggingFacePipeline (#17005) 8 months ago
huggingface_text_gen_inference.py infra: add print rule to ruff (#16221) 8 months ago
human.py infra: add print rule to ruff (#16221) 8 months ago
javelin_ai_gateway.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
koboldai.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
konko.py community[minor]: Adding Konko Completion endpoint (#15570) 8 months ago
llamacpp.py infra: add print rule to ruff (#16221) 8 months ago
llamafile.py community[minor]: Adds Llamafile as an LLM (#17431) 7 months ago
loading.py core[patch]: Support .yml extension for YAML (#16783) 7 months ago
manifest.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
minimax.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
mlflow.py Remove unused `Params` (#14385) 9 months ago
mlflow_ai_gateway.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
modal.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
mosaicml.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
nlpcloud.py community[patch]: fix top_p type hint (#15452) 8 months ago
oci_data_science_model_deployment_endpoint.py docs, community[patch], experimental[patch], langchain[patch], cli[pa… (#15412) 9 months ago
oci_generative_ai.py community[patch]: docstrings (#16810) 8 months ago
octoai_endpoint.py community[minor]: Update OctoAI LLM, Embedding and documentation (#16710) 8 months ago
ollama.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
opaqueprompts.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
openai.py openai[patch]: Explicitly support embedding dimensions (#16596) 8 months ago
openllm.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
openlm.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
pai_eas_endpoint.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
petals.py Refactor: use SecretStr for Petals llms (#15121) 9 months ago
pipelineai.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
predibase.py Refactor: use SecretStr for Predibase llms (#15119) 9 months ago
predictionguard.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
promptlayer_openai.py Do not issue beta or deprecation warnings on internal calls (#15641) 9 months ago
replicate.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
rwkv.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
sagemaker_endpoint.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
self_hosted.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
self_hosted_hugging_face.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
stochasticai.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
symblai_nebula.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
textgen.py infra: add print rule to ruff (#16221) 8 months ago
titan_takeoff.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
titan_takeoff_pro.py docs: docstrings `langchain_community` update (#14889) 9 months ago
together.py together[minor]: add llm (#15853) 9 months ago
tongyi.py community[patch]: docstrings (#16810) 8 months ago
utils.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
vertexai.py infra: add -p to mkdir in lint steps (#17013) 8 months ago
vllm.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
volcengine_maas.py Refactor: use SecretStr for VolcEngineMaas llms (#15117) 9 months ago
watsonxllm.py community[patch]: Invoke callback prior to yielding token (#17346) 7 months ago
writer.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 10 months ago
xinference.py docs: docstrings `langchain_community` update (#14889) 9 months ago
yandex.py community[patch]: chat model mypy fixes (#17061) 8 months ago