# DeepSparse

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/llms/deepsparse/DeepSparse)

Neural Magic DeepSparse LLM interface.
To use, you should have the ``deepsparse`` or ``deepsparse-nightly``
python package installed. See https://github.com/neuralmagic/deepsparse
This interface let's you deploy optimized LLMs straight from the
[SparseZoo](https://sparsezoo.neuralmagic.com/?useCase=text_generation)
Example:
    .. code-block:: python
        from langchain_community.llms import DeepSparse
        llm = DeepSparse(model="zoo:nlg/text_generation/codegen_mono-350m/pytorch/huggingface/bigpython_bigquery_thepile/base_quant-none")

## Signature

```python
DeepSparse()
```

## Extends

- `LLM`

## Properties

- `pipeline`
- `model`
- `model_configuration`
- `generation_config`
- `streaming`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/deepsparse/DeepSparse/validate_environment)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/llms/deepsparse.py#L19)