text-generation-inference/server
drbh 55acb86f42 Outlines guided generation (#1539)
This WIP PR starts to add grammar support via outlines, currently this
PR supports very simple regex grammars and does not optimize for
precompiling or caching grammar fsm's.

todo:
- [X] add simple outlines guidance to `NextTokenChooser`
- [X] update protos for grammar
- [X] update generation params API
- [X] constrain simple grammar
- [ ] support parsing more complex grammar into fsm
- [ ] support all outline support grammar types
- [ ] explore optimizations to avoid recompiling grammars

guided request
```bash
curl -s 'http://localhost:3000/generate' \
--header 'Content-Type: application/json' \
--data-raw '{
    "inputs": "make an email for david: \n",
    "parameters": {
        "max_new_tokens": 6,
        "grammar": "[\\w-]+@([\\w-]+\\.)+[\\w-]+"
    }
}' | jq
```
response
```json
{
  "generated_text": "david@example.com"
}
```

unguided request
```bash
curl -s 'http://localhost:3000/generate' \
--header 'Content-Type: application/json' \
--data '{
    "inputs": "make an email for david: \n",
    "parameters": {
        "max_new_tokens": 6
    }
}' | jq
```
response
```json
{
  "generated_text": "    email = 'david"
}
```
2024-04-24 14:57:37 +03:00
..
custom_kernels Add RoCm support (#1243) 2023-11-27 14:08:12 +01:00
exllama_kernels feat: experimental support for cuda graphs (#1428) 2024-04-24 13:15:45 +03:00
exllamav2_kernels feat: experimental support for cuda graphs (#1428) 2024-04-24 13:15:45 +03:00
tests feat(server): add frequency penalty (#1541) 2024-04-24 08:43:50 +00:00
text_generation_server Outlines guided generation (#1539) 2024-04-24 14:57:37 +03:00
.gitignore Impl simple mamba model (#1480) 2024-04-23 11:45:11 +03:00
Makefile Impl simple mamba model (#1480) 2024-04-23 11:45:11 +03:00
Makefile-awq feat: experimental support for cuda graphs (#1428) 2024-04-24 13:15:45 +03:00
Makefile-eetq feat: eetq gemv optimization when batch_size <= 4 (#1502) 2024-04-23 09:20:14 +03:00
Makefile-flash-att Add RoCm support (#1243) 2023-11-27 14:08:12 +01:00
Makefile-flash-att-v2 make install-flash-attn-v2-cuda should work like make install-flash-attn-v2 used to work. (#1294) 2023-11-28 16:28:40 +01:00
Makefile-selective-scan Impl simple mamba model (#1480) 2024-04-23 11:45:11 +03:00
Makefile-vllm Speculative (#1308) 2024-04-18 12:39:39 +00:00
poetry.lock Outlines guided generation (#1539) 2024-04-24 14:57:37 +03:00
pyproject.toml Outlines guided generation (#1539) 2024-04-24 14:57:37 +03:00
README.md feat(router): refactor API and add openAPI schemas (#53) 2023-02-03 12:43:37 +01:00
requirements_common.txt Add RoCm support (#1243) 2023-11-27 14:08:12 +01:00
requirements_cuda.txt v1.4.0 (#1494) 2024-04-22 15:47:42 +03:00
requirements_rocm.txt v1.4.0 (#1494) 2024-04-22 15:47:42 +03:00
requirements.txt Update dependencies (#69) 2024-02-25 13:07:47 +01:00

Text Generation Inference Python gRPC Server

A Python gRPC server for Text Generation Inference

Install

make install

Run

make run-dev