vllm-project / vllm

A high-throughput and memory-efficient inference and serving engine for LLMs
https://docs.vllm.ai
Apache License 2.0
26.76k stars 3.92k forks source link

[Bug]: OpenAI API emulation incompatible with shell_gpt OpenAI API calls #5797

Open tmbdev opened 2 months ago

tmbdev commented 2 months ago

Your current environment

Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Ubuntu 24.04 LTS (x86_64)
GCC version: (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.39

Python version: 3.12.3 | packaged by Anaconda, Inc. | (main, May  6 2024, 19:46:43) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-35-generic-x86_64-with-glibc2.39
Is CUDA available: N/A
CUDA runtime version: 12.0.140
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: 
GPU 0: NVIDIA RTX 6000 Ada Generation
GPU 1: NVIDIA RTX 6000 Ada Generation

Nvidia driver version: 535.171.04
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.2
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.2
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.2
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.2
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.2
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.2
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.2
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

CPU:
Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        48 bits physical, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               64
On-line CPU(s) list:                  0-63
Vendor ID:                            AuthenticAMD
Model name:                           AMD Ryzen Threadripper PRO 5975WX 32-Cores
CPU family:                           25
Model:                                8
Thread(s) per core:                   2
Core(s) per socket:                   32
Socket(s):                            1
Stepping:                             2
Frequency boost:                      enabled
CPU(s) scaling MHz:                   29%
CPU max MHz:                          7006.6401
CPU min MHz:                          1800.0000
BogoMIPS:                             7187.05
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin brs arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm debug_swap
Virtualization:                       AMD-V
L1d cache:                            1 MiB (32 instances)
L1i cache:                            1 MiB (32 instances)
L2 cache:                             16 MiB (32 instances)
L3 cache:                             128 MiB (4 instances)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-63
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Vulnerable: Safe RET, no microcode
Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] No relevant packages
[conda] No relevant packages
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: N/A
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X  PHB 0-63    0       N/A
GPU1    PHB  X  0-63    0       N/A

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

๐Ÿ› Describe the bug

Requests from shell_gpt work fine with OpenAI's API, but they don't work with vllm's emulation of the OpenAI API.

https://github.com/TheR1D/shell_gpt

I would expect OpenAI API emulation to work with common tools like shell_gpt

Script started on 2024-06-24 16:15:33-04:00 [TERM="dumb" TTY="/dev/pts/7" COLUMNS="118" LINES="56"]
sedna:~$ OPENAI_BASE_URL=https://api.openai.com/v1 sgpt --model=gpt-4o 'Capital of France?'
The capital of France is Paris.
sedna:~$ OPENAI_BASE_URL=http://triton:8000/v1 sgpt --model=Qwen/Qwen2-beta-7B-Chat 'Capital of France?'

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/sgpt/app.py:229 in main โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   226 โ”‚   โ”‚   โ”‚   functions=function_schemas,                                                    โ”‚
โ”‚   227 โ”‚   โ”‚   )                                                                                  โ”‚
โ”‚   228 โ”‚   else:                                                                                  โ”‚
โ”‚ โฑ 229 โ”‚   โ”‚   full_completion = DefaultHandler(role_class, md).handle(                           โ”‚
โ”‚   230 โ”‚   โ”‚   โ”‚   prompt=prompt,                                                                 โ”‚
โ”‚   231 โ”‚   โ”‚   โ”‚   model=model,                                                                   โ”‚
โ”‚   232 โ”‚   โ”‚   โ”‚   temperature=temperature,                                                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                        โ”‚
โ”‚ โ”‚               cache = True                                            โ”‚                        โ”‚
โ”‚ โ”‚                chat = None                                            โ”‚                        โ”‚
โ”‚ โ”‚                code = False                                           โ”‚                        โ”‚
โ”‚ โ”‚         create_role = None                                            โ”‚                        โ”‚
โ”‚ โ”‚      describe_shell = False                                           โ”‚                        โ”‚
โ”‚ โ”‚              editor = False                                           โ”‚                        โ”‚
โ”‚ โ”‚    function_schemas = None                                            โ”‚                        โ”‚
โ”‚ โ”‚           functions = True                                            โ”‚                        โ”‚
โ”‚ โ”‚   install_functions = None                                            โ”‚                        โ”‚
โ”‚ โ”‚ install_integration = None                                            โ”‚                        โ”‚
โ”‚ โ”‚         interaction = True                                            โ”‚                        โ”‚
โ”‚ โ”‚          list_chats = None                                            โ”‚                        โ”‚
โ”‚ โ”‚          list_roles = None                                            โ”‚                        โ”‚
โ”‚ โ”‚                  md = True                                            โ”‚                        โ”‚
โ”‚ โ”‚               model = 'Qwen/Qwen2-beta-7B-Chat'                       โ”‚                        โ”‚
โ”‚ โ”‚              prompt = 'Capital of France?'                            โ”‚                        โ”‚
โ”‚ โ”‚                repl = None                                            โ”‚                        โ”‚
โ”‚ โ”‚                role = None                                            โ”‚                        โ”‚
โ”‚ โ”‚          role_class = <sgpt.role.SystemRole object at 0x7fead891ade0> โ”‚                        โ”‚
โ”‚ โ”‚               shell = False                                           โ”‚                        โ”‚
โ”‚ โ”‚           show_chat = None                                            โ”‚                        โ”‚
โ”‚ โ”‚           show_role = None                                            โ”‚                        โ”‚
โ”‚ โ”‚        stdin_passed = False                                           โ”‚                        โ”‚
โ”‚ โ”‚         temperature = 0.0                                             โ”‚                        โ”‚
โ”‚ โ”‚               top_p = 1.0                                             โ”‚                        โ”‚
โ”‚ โ”‚             version = None                                            โ”‚                        โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/sgpt/handlers/handler.p โ”‚
โ”‚ y:158 in handle                                                                                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   155 โ”‚   โ”‚   โ”‚   caching=caching,                                                               โ”‚
โ”‚   156 โ”‚   โ”‚   โ”‚   **kwargs,                                                                      โ”‚
โ”‚   157 โ”‚   โ”‚   )                                                                                  โ”‚
โ”‚ โฑ 158 โ”‚   โ”‚   return self.printer(generator, not disable_stream)                                 โ”‚
โ”‚   159                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚        caching = True                                                                        โ”‚ โ”‚
โ”‚ โ”‚ disable_stream = False                                                                       โ”‚ โ”‚
โ”‚ โ”‚      functions = None                                                                        โ”‚ โ”‚
โ”‚ โ”‚      generator = <generator object Cache.__call__.<locals>.wrapper at 0x7fead8b45b40>        โ”‚ โ”‚
โ”‚ โ”‚         kwargs = {}                                                                          โ”‚ โ”‚
โ”‚ โ”‚       messages = [                                                                           โ”‚ โ”‚
โ”‚ โ”‚                  โ”‚   {                                                                       โ”‚ โ”‚
โ”‚ โ”‚                  โ”‚   โ”‚   'role': 'system',                                                   โ”‚ โ”‚
โ”‚ โ”‚                  โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and system        โ”‚ โ”‚
โ”‚ โ”‚                  administration assistant.\nYou ar'+281                                      โ”‚ โ”‚
โ”‚ โ”‚                  โ”‚   },                                                                      โ”‚ โ”‚
โ”‚ โ”‚                  โ”‚   {'role': 'user', 'content': 'Capital of France?'}                       โ”‚ โ”‚
โ”‚ โ”‚                  ]                                                                           โ”‚ โ”‚
โ”‚ โ”‚          model = 'Qwen/Qwen2-beta-7B-Chat'                                                   โ”‚ โ”‚
โ”‚ โ”‚         prompt = 'Capital of France?'                                                        โ”‚ โ”‚
โ”‚ โ”‚           self = <sgpt.handlers.default_handler.DefaultHandler object at 0x7fead8c0fef0>     โ”‚ โ”‚
โ”‚ โ”‚    temperature = 0.0                                                                         โ”‚ โ”‚
โ”‚ โ”‚          top_p = 1.0                                                                         โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/sgpt/printer.py:23 in   โ”‚
โ”‚ __call__                                                                                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   20 โ”‚                                                                                           โ”‚
โ”‚   21 โ”‚   def __call__(self, chunks: Generator[str, None, None], live: bool = True) -> str:       โ”‚
โ”‚   22 โ”‚   โ”‚   if live:                                                                            โ”‚
โ”‚ โฑ 23 โ”‚   โ”‚   โ”‚   return self.live_print(chunks)                                                  โ”‚
โ”‚   24 โ”‚   โ”‚   with self.console.status("[bold green]Loading..."):                                 โ”‚
โ”‚   25 โ”‚   โ”‚   โ”‚   full_completion = "".join(chunks)                                               โ”‚
โ”‚   26 โ”‚   โ”‚   self.static_print(full_completion)                                                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                โ”‚
โ”‚ โ”‚ chunks = <generator object Cache.__call__.<locals>.wrapper at 0x7fead8b45b40> โ”‚                โ”‚
โ”‚ โ”‚   live = True                                                                 โ”‚                โ”‚
โ”‚ โ”‚   self = <sgpt.printer.MarkdownPrinter object at 0x7fead8919940>              โ”‚                โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/sgpt/printer.py:38 in   โ”‚
โ”‚ live_print                                                                                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   35 โ”‚   def live_print(self, chunks: Generator[str, None, None]) -> str:                        โ”‚
โ”‚   36 โ”‚   โ”‚   full_completion = ""                                                                โ”‚
โ”‚   37 โ”‚   โ”‚   with Live(console=self.console) as live:                                            โ”‚
โ”‚ โฑ 38 โ”‚   โ”‚   โ”‚   for chunk in chunks:                                                            โ”‚
โ”‚   39 โ”‚   โ”‚   โ”‚   โ”‚   full_completion += chunk                                                    โ”‚
โ”‚   40 โ”‚   โ”‚   โ”‚   โ”‚   markdown = Markdown(markup=full_completion, code_theme=self.theme)          โ”‚
โ”‚   41 โ”‚   โ”‚   โ”‚   โ”‚   live.update(markdown, refresh=True)                                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ       โ”‚
โ”‚ โ”‚          chunks = <generator object Cache.__call__.<locals>.wrapper at 0x7fead8b45b40> โ”‚       โ”‚
โ”‚ โ”‚ full_completion = ''                                                                   โ”‚       โ”‚
โ”‚ โ”‚            live = <rich.live.Live object at 0x7fead891ac60>                            โ”‚       โ”‚
โ”‚ โ”‚            self = <sgpt.printer.MarkdownPrinter object at 0x7fead8919940>              โ”‚       โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/sgpt/cache.py:37 in     โ”‚
โ”‚ wrapper                                                                                          โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   34 โ”‚   โ”‚   โ”‚   โ”‚   yield file.read_text()                                                      โ”‚
โ”‚   35 โ”‚   โ”‚   โ”‚   โ”‚   return                                                                      โ”‚
โ”‚   36 โ”‚   โ”‚   โ”‚   result = ""                                                                     โ”‚
โ”‚ โฑ 37 โ”‚   โ”‚   โ”‚   for i in func(*args, **kwargs):                                                 โ”‚
โ”‚   38 โ”‚   โ”‚   โ”‚   โ”‚   result += i                                                                 โ”‚
โ”‚   39 โ”‚   โ”‚   โ”‚   โ”‚   yield i                                                                     โ”‚
โ”‚   40 โ”‚   โ”‚   โ”‚   if "@FunctionCall" not in result:                                               โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚   args = (<sgpt.handlers.default_handler.DefaultHandler object at 0x7fead8c0fef0>,)          โ”‚ โ”‚
โ”‚ โ”‚   file = PosixPath('/tmp/cache/9b091832b44135f3a9c6d16f9555d2b7')                            โ”‚ โ”‚
โ”‚ โ”‚   func = <function Handler.get_completion at 0x7fead8902200>                                 โ”‚ โ”‚
โ”‚ โ”‚    key = '9b091832b44135f3a9c6d16f9555d2b7'                                                  โ”‚ โ”‚
โ”‚ โ”‚ kwargs = {                                                                                   โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   'model': 'Qwen/Qwen2-beta-7B-Chat',                                             โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   'temperature': 0.0,                                                             โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   'top_p': 1.0,                                                                   โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   'messages': [                                                                   โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   โ”‚   {                                                                           โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   โ”‚   โ”‚   'role': 'system',                                                       โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and system            โ”‚ โ”‚
โ”‚ โ”‚          administration assistant.\nYou ar'+281                                              โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   โ”‚   },                                                                          โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   โ”‚   {'role': 'user', 'content': 'Capital of France?'}                           โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   ],                                                                              โ”‚ โ”‚
โ”‚ โ”‚          โ”‚   'functions': None                                                               โ”‚ โ”‚
โ”‚ โ”‚          }                                                                                   โ”‚ โ”‚
โ”‚ โ”‚ result = ''                                                                                  โ”‚ โ”‚
โ”‚ โ”‚   self = <sgpt.cache.Cache object at 0x7fead8918440>                                         โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/sgpt/handlers/handler.p โ”‚
โ”‚ y:99 in get_completion                                                                           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    96 โ”‚   โ”‚   if is_shell_role or is_code_role or is_dsc_shell_role:                             โ”‚
โ”‚    97 โ”‚   โ”‚   โ”‚   functions = None                                                               โ”‚
โ”‚    98 โ”‚   โ”‚                                                                                      โ”‚
โ”‚ โฑ  99 โ”‚   โ”‚   response = completion(                                                             โ”‚
โ”‚   100 โ”‚   โ”‚   โ”‚   model=model,                                                                   โ”‚
โ”‚   101 โ”‚   โ”‚   โ”‚   temperature=temperature,                                                       โ”‚
โ”‚   102 โ”‚   โ”‚   โ”‚   top_p=top_p,                                                                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚         arguments = ''                                                                       โ”‚ โ”‚
โ”‚ โ”‚         functions = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚      is_code_role = False                                                                    โ”‚ โ”‚
โ”‚ โ”‚ is_dsc_shell_role = False                                                                    โ”‚ โ”‚
โ”‚ โ”‚     is_shell_role = False                                                                    โ”‚ โ”‚
โ”‚ โ”‚          messages = [                                                                        โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   {                                                                    โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'role': 'system',                                                โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and system     โ”‚ โ”‚
โ”‚ โ”‚                     administration assistant.\nYou ar'+281                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   },                                                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   {'role': 'user', 'content': 'Capital of France?'}                    โ”‚ โ”‚
โ”‚ โ”‚                     ]                                                                        โ”‚ โ”‚
โ”‚ โ”‚             model = 'Qwen/Qwen2-beta-7B-Chat'                                                โ”‚ โ”‚
โ”‚ โ”‚              name = ''                                                                       โ”‚ โ”‚
โ”‚ โ”‚              self = <sgpt.handlers.default_handler.DefaultHandler object at 0x7fead8c0fef0>  โ”‚ โ”‚
โ”‚ โ”‚       temperature = 0.0                                                                      โ”‚ โ”‚
โ”‚ โ”‚             top_p = 1.0                                                                      โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/openai/_utils/_utils.py โ”‚
โ”‚ :277 in wrapper                                                                                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   274 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   else:                                                                  โ”‚
โ”‚   275 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   msg = f"Missing required argument: {quote(missing[0])}"            โ”‚
โ”‚   276 โ”‚   โ”‚   โ”‚   โ”‚   raise TypeError(msg)                                                       โ”‚
โ”‚ โฑ 277 โ”‚   โ”‚   โ”‚   return func(*args, **kwargs)                                                   โ”‚
โ”‚   278 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   279 โ”‚   โ”‚   return wrapper  # type: ignore                                                     โ”‚
โ”‚   280                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚            _ = <openai.resources.chat.completions.Completions object at 0x7fead8b94890>      โ”‚ โ”‚
โ”‚ โ”‚         args = (<openai.resources.chat.completions.Completions object at 0x7fead8b94890>,)   โ”‚ โ”‚
โ”‚ โ”‚         func = <function Completions.create at 0x7fead887d120>                               โ”‚ โ”‚
โ”‚ โ”‚ given_params = {'model', 'functions', 'self', 'top_p', 'messages', 'stream', 'temperature'}  โ”‚ โ”‚
โ”‚ โ”‚            i = 0                                                                             โ”‚ โ”‚
โ”‚ โ”‚          key = 'stream'                                                                      โ”‚ โ”‚
โ”‚ โ”‚       kwargs = {                                                                             โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   'model': 'Qwen/Qwen2-beta-7B-Chat',                                       โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   'temperature': 0.0,                                                       โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   'top_p': 1.0,                                                             โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   'messages': [                                                             โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   โ”‚   {                                                                     โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   โ”‚   โ”‚   'role': 'system',                                                 โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and system      โ”‚ โ”‚
โ”‚ โ”‚                administration assistant.\nYou ar'+281                                        โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   โ”‚   },                                                                    โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   โ”‚   {'role': 'user', 'content': 'Capital of France?'}                     โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   ],                                                                        โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   'functions': None,                                                        โ”‚ โ”‚
โ”‚ โ”‚                โ”‚   'stream': True                                                            โ”‚ โ”‚
โ”‚ โ”‚                }                                                                             โ”‚ โ”‚
โ”‚ โ”‚      matches = True                                                                          โ”‚ โ”‚
โ”‚ โ”‚   positional = ['self']                                                                      โ”‚ โ”‚
โ”‚ โ”‚      variant = ['messages', 'model']                                                         โ”‚ โ”‚
โ”‚ โ”‚     variants = (['messages', 'model'], ['messages', 'model', 'stream'])                      โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/openai/resources/chat/c โ”‚
โ”‚ ompletions.py:606 in create                                                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    603 โ”‚   โ”‚   extra_body: Body | None = None,                                                   โ”‚
โ”‚    604 โ”‚   โ”‚   timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,                     โ”‚
โ”‚    605 โ”‚   ) -> ChatCompletion | Stream[ChatCompletionChunk]:                                    โ”‚
โ”‚ โฑ  606 โ”‚   โ”‚   return self._post(                                                                โ”‚
โ”‚    607 โ”‚   โ”‚   โ”‚   "/chat/completions",                                                          โ”‚
โ”‚    608 โ”‚   โ”‚   โ”‚   body=maybe_transform(                                                         โ”‚
โ”‚    609 โ”‚   โ”‚   โ”‚   โ”‚   {                                                                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚          extra_body = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚       extra_headers = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚         extra_query = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚   frequency_penalty = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚       function_call = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚           functions = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚          logit_bias = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚            logprobs = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚          max_tokens = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚            messages = [                                                                      โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   {                                                                  โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   'role': 'system',                                              โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and system   โ”‚ โ”‚
โ”‚ โ”‚                       administration assistant.\nYou ar'+281                                 โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   },                                                                 โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   {'role': 'user', 'content': 'Capital of France?'}                  โ”‚ โ”‚
โ”‚ โ”‚                       ]                                                                      โ”‚ โ”‚
โ”‚ โ”‚               model = 'Qwen/Qwen2-beta-7B-Chat'                                              โ”‚ โ”‚
โ”‚ โ”‚                   n = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚ parallel_tool_calls = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚    presence_penalty = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚     response_format = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚                seed = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚                self = <openai.resources.chat.completions.Completions object at               โ”‚ โ”‚
โ”‚ โ”‚                       0x7fead8b94890>                                                        โ”‚ โ”‚
โ”‚ โ”‚                stop = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚              stream = True                                                                   โ”‚ โ”‚
โ”‚ โ”‚      stream_options = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚         temperature = 0.0                                                                    โ”‚ โ”‚
โ”‚ โ”‚             timeout = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚         tool_choice = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚               tools = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚        top_logprobs = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ”‚               top_p = 1.0                                                                    โ”‚ โ”‚
โ”‚ โ”‚                user = NOT_GIVEN                                                              โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/openai/_base_client.py: โ”‚
โ”‚ 1240 in post                                                                                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   1237 โ”‚   โ”‚   opts = FinalRequestOptions.construct(                                             โ”‚
โ”‚   1238 โ”‚   โ”‚   โ”‚   method="post", url=path, json_data=body, files=to_httpx_files(files), **opti  โ”‚
โ”‚   1239 โ”‚   โ”‚   )                                                                                 โ”‚
โ”‚ โฑ 1240 โ”‚   โ”‚   return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=str  โ”‚
โ”‚   1241 โ”‚                                                                                         โ”‚
โ”‚   1242 โ”‚   def patch(                                                                            โ”‚
โ”‚   1243 โ”‚   โ”‚   self,                                                                             โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚       body = {                                                                               โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'messages': [                                                               โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   {                                                                       โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   โ”‚   'role': 'system',                                                   โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and system        โ”‚ โ”‚
โ”‚ โ”‚              administration assistant.\nYou ar'+281                                          โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   },                                                                      โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   {'role': 'user', 'content': 'Capital of France?'}                       โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   ],                                                                          โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'model': 'Qwen/Qwen2-beta-7B-Chat',                                         โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'frequency_penalty': NOT_GIVEN,                                             โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'function_call': NOT_GIVEN,                                                 โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'functions': None,                                                          โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'logit_bias': NOT_GIVEN,                                                    โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'logprobs': NOT_GIVEN,                                                      โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'max_tokens': NOT_GIVEN,                                                    โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'n': NOT_GIVEN,                                                             โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   'parallel_tool_calls': NOT_GIVEN,                                           โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   ... +12                                                                     โ”‚ โ”‚
โ”‚ โ”‚              }                                                                               โ”‚ โ”‚
โ”‚ โ”‚    cast_to = <class 'openai.types.chat.chat_completion.ChatCompletion'>                      โ”‚ โ”‚
โ”‚ โ”‚      files = None                                                                            โ”‚ โ”‚
โ”‚ โ”‚    options = {}                                                                              โ”‚ โ”‚
โ”‚ โ”‚       opts = FinalRequestOptions(                                                            โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   method='post',                                                              โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   url='/chat/completions',                                                    โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   params={},                                                                  โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   headers=NOT_GIVEN,                                                          โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   max_retries=NOT_GIVEN,                                                      โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   timeout=NOT_GIVEN,                                                          โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   files=None,                                                                 โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   idempotency_key=None,                                                       โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   post_parser=NOT_GIVEN,                                                      โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   json_data={                                                                 โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   'messages': [                                                           โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   โ”‚   {                                                                   โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   โ”‚   โ”‚   'role': 'system',                                               โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and system    โ”‚ โ”‚
โ”‚ โ”‚              administration assistant.\nYou ar'+281                                          โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   โ”‚   },                                                                  โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   โ”‚   {'role': 'user', 'content': 'Capital of France?'}                   โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   ],                                                                      โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   'model': 'Qwen/Qwen2-beta-7B-Chat',                                     โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   'functions': None,                                                      โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   'stream': True,                                                         โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   'temperature': 0.0,                                                     โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   โ”‚   'top_p': 1.0                                                            โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   },                                                                          โ”‚ โ”‚
โ”‚ โ”‚              โ”‚   extra_json=None                                                             โ”‚ โ”‚
โ”‚ โ”‚              )                                                                               โ”‚ โ”‚
โ”‚ โ”‚       path = '/chat/completions'                                                             โ”‚ โ”‚
โ”‚ โ”‚       self = <openai.OpenAI object at 0x7fead8a8a720>                                        โ”‚ โ”‚
โ”‚ โ”‚     stream = True                                                                            โ”‚ โ”‚
โ”‚ โ”‚ stream_cls = openai.Stream[openai.types.chat.chat_completion_chunk.ChatCompletionChunk]      โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/openai/_base_client.py: โ”‚
โ”‚ 921 in request                                                                                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    918 โ”‚   โ”‚   stream: bool = False,                                                             โ”‚
โ”‚    919 โ”‚   โ”‚   stream_cls: type[_StreamT] | None = None,                                         โ”‚
โ”‚    920 โ”‚   ) -> ResponseT | _StreamT:                                                            โ”‚
โ”‚ โฑ  921 โ”‚   โ”‚   return self._request(                                                             โ”‚
โ”‚    922 โ”‚   โ”‚   โ”‚   cast_to=cast_to,                                                              โ”‚
โ”‚    923 โ”‚   โ”‚   โ”‚   options=options,                                                              โ”‚
โ”‚    924 โ”‚   โ”‚   โ”‚   stream=stream,                                                                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚           cast_to = <class 'openai.types.chat.chat_completion.ChatCompletion'>               โ”‚ โ”‚
โ”‚ โ”‚           options = FinalRequestOptions(                                                     โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   method='post',                                                       โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   url='/chat/completions',                                             โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   params={},                                                           โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   headers=NOT_GIVEN,                                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   max_retries=NOT_GIVEN,                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   timeout=NOT_GIVEN,                                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   files=None,                                                          โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   idempotency_key=None,                                                โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   post_parser=NOT_GIVEN,                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   json_data={                                                          โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'messages': [                                                    โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   {                                                            โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   โ”‚   'role': 'system',                                        โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and    โ”‚ โ”‚
โ”‚ โ”‚                     system administration assistant.\nYou ar'+281                            โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   },                                                           โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   {'role': 'user', 'content': 'Capital of France?'}            โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   ],                                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'model': 'Qwen/Qwen2-beta-7B-Chat',                              โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'functions': None,                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'stream': True,                                                  โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'temperature': 0.0,                                              โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'top_p': 1.0                                                     โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   },                                                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   extra_json=None                                                      โ”‚ โ”‚
โ”‚ โ”‚                     )                                                                        โ”‚ โ”‚
โ”‚ โ”‚ remaining_retries = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚              self = <openai.OpenAI object at 0x7fead8a8a720>                                 โ”‚ โ”‚
โ”‚ โ”‚            stream = True                                                                     โ”‚ โ”‚
โ”‚ โ”‚        stream_cls = openai.Stream[openai.types.chat.chat_completion_chunk.ChatCompletionChuโ€ฆ โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/tmb/.local/share/pipx/venvs/shell-gpt/lib/python3.12/site-packages/openai/_base_client.py: โ”‚
โ”‚ 1020 in _request                                                                                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   1017 โ”‚   โ”‚   โ”‚   โ”‚   err.response.read()                                                       โ”‚
โ”‚   1018 โ”‚   โ”‚   โ”‚                                                                                 โ”‚
โ”‚   1019 โ”‚   โ”‚   โ”‚   log.debug("Re-raising status error")                                          โ”‚
โ”‚ โฑ 1020 โ”‚   โ”‚   โ”‚   raise self._make_status_error_from_response(err.response) from None           โ”‚
โ”‚   1021 โ”‚   โ”‚                                                                                     โ”‚
โ”‚   1022 โ”‚   โ”‚   return self._process_response(                                                    โ”‚
โ”‚   1023 โ”‚   โ”‚   โ”‚   cast_to=cast_to,                                                              โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚           cast_to = <class 'openai.types.chat.chat_completion.ChatCompletion'>               โ”‚ โ”‚
โ”‚ โ”‚            kwargs = {}                                                                       โ”‚ โ”‚
โ”‚ โ”‚           options = FinalRequestOptions(                                                     โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   method='post',                                                       โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   url='/chat/completions',                                             โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   params={},                                                           โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   headers=NOT_GIVEN,                                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   max_retries=NOT_GIVEN,                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   timeout=NOT_GIVEN,                                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   files=None,                                                          โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   idempotency_key=None,                                                โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   post_parser=NOT_GIVEN,                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   json_data={                                                          โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'messages': [                                                    โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   {                                                            โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   โ”‚   'role': 'system',                                        โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   โ”‚   'content': 'You are ShellGPT\nYou are programming and    โ”‚ โ”‚
โ”‚ โ”‚                     system administration assistant.\nYou ar'+281                            โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   },                                                           โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   โ”‚   {'role': 'user', 'content': 'Capital of France?'}            โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   ],                                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'model': 'Qwen/Qwen2-beta-7B-Chat',                              โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'functions': None,                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'stream': True,                                                  โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'temperature': 0.0,                                              โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   'top_p': 1.0                                                     โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   },                                                                   โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   extra_json=None                                                      โ”‚ โ”‚
โ”‚ โ”‚                     )                                                                        โ”‚ โ”‚
โ”‚ โ”‚ remaining_retries = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚           request = <Request('POST', 'http://triton:8000/v1/chat/completions')>              โ”‚ โ”‚
โ”‚ โ”‚          response = <Response [400 Bad Request]>                                             โ”‚ โ”‚
โ”‚ โ”‚           retries = 2                                                                        โ”‚ โ”‚
โ”‚ โ”‚              self = <openai.OpenAI object at 0x7fead8a8a720>                                 โ”‚ โ”‚
โ”‚ โ”‚            stream = True                                                                     โ”‚ โ”‚
โ”‚ โ”‚        stream_cls = openai.Stream[openai.types.chat.chat_completion_chunk.ChatCompletionChuโ€ฆ โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
BadRequestError: Error code: 400 - {'object': 'error', 'message': "[{'type': 'extra_forbidden', 'loc': ('body', 
'functions'), 'msg': 'Extra inputs are not permitted', 'input': None}]", 'type': 'BadRequestError', 'param': None, 
'code': 400}
sedna:~$ exit

Script done on 2024-06-24 16:15:42-04:00 [COMMAND_EXIT_CODE="1"]
dolanp83 commented 1 month ago

I have the same issues with LangChain's langchain_openai.ChatOpenAI. It sends this parameter in the request but vLLM balks and returns a 400.

amihalik commented 1 month ago

I suspect that vLLM doesn't like that 'functions': None argument. Can you try running something like

sgpt --no-functions --model=Qwen/Qwen2-beta-7B-Chat 'Capital of France?'