`llm.batch` method fails with `max_concurrency` in config
Labels: name: auto:bug, name: area: models, name: area: lcel

### System Info

- langchain version: 0.0.320
- python: 3.9.17

### Who can help?

_No response_

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

Similar to the [guide](https://python.langchain.com/docs/expression_language/interface#batch) for `chat_models.batch`, but if we use `llm` instead, `batch` and `abatch` methods will throw exceptions.

Here is an example for `batch`
```py
model = OpenAI()
prompt = PromptTemplate.from_template("tell me a joke about {topic}")
chain = prompt | model
chain.batch([{"topic": "bears"}, {"topic": "cats"}], config={"max_concurrency": 5})
```
You get the following error for dead loop exceeding recursion limit
```py
...
--> 300         for output in self.batch(
    301             batch, config=config, return_exceptions=return_exceptions, **kwargs
    302         )
    303     ]

File [/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:273](https://file+.vscode-resource.vscode-cdn.net/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:273), in BaseLLM.batch(self, inputs, config, return_exceptions, **kwargs)
    270 if not inputs:
    271     return []
--> 273 config = get_config_list(config, len(inputs))
    274 max_concurrency = config[0].get("max_concurrency")
    276 if max_concurrency is None:

File [/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/schema/runnable/config.py:115](https://file+.vscode-resource.vscode-cdn.net/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/schema/runnable/config.py:115), in get_config_list(config, length)
    108 def get_config_list(
    109     config: Optional[Union[RunnableConfig, List[RunnableConfig]]], length: int
    110 ) -> List[RunnableConfig]:
    111     """
    112     Helper method to get a list of configs from a single config or a list of
    113     configs, useful for subclasses overriding batch() or abatch().
    114     """
--> 115     if length < 0:
    116         raise ValueError(f"length must be >= 0, but got {length}")
    117     if isinstance(config, list) and len(config) != length:

RecursionError: maximum recursion depth exceeded in comparison
```

Or if you set `max_concurrency` to  be smaller than the length of the prompts, say 1
```py
chain.batch([{"topic": "bears"}, {"topic": "cats"}], config={"max_concurrency": 1})

ValueError                                Traceback (most recent call last)
...
File [/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/schema/runnable/base.py:1271](https://file+.vscode-resource.vscode-cdn.net/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/schema/runnable/base.py:1271), in RunnableSequence.batch(self, inputs, config, return_exceptions, **kwargs)
   1269     else:
   1270         for i, step in enumerate(self.steps):
-> 1271             inputs = step.batch(
   1272                 inputs,
   1273                 [
   1274                     # each step a child run of the corresponding root run
   1275                     patch_config(
   1276                         config, callbacks=rm.get_child(f"seq:step:{i+1}")
   1277                     )
   1278                     for rm, config in zip(run_managers, configs)
   1279                 ],
   1280             )
   1282 # finish the root runs
   1283 except BaseException as e:

File [/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:297](https://file+.vscode-resource.vscode-cdn.net/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:297), in BaseLLM.batch(self, inputs, config, return_exceptions, **kwargs)
    292 else:
    293     batches = [
    294         inputs[i : i + max_concurrency]
    295         for i in range(0, len(inputs), max_concurrency)
    296     ]
--> 297     return [
    298         output
    299         for batch in batches
    300         for output in self.batch(
    301             batch, config=config, return_exceptions=return_exceptions, **kwargs
    302         )
    303     ]

File [/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:300](https://file+.vscode-resource.vscode-cdn.net/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:300), in <listcomp>(.0)
    292 else:
    293     batches = [
    294         inputs[i : i + max_concurrency]
    295         for i in range(0, len(inputs), max_concurrency)
    296     ]
    297     return [
    298         output
    299         for batch in batches
--> 300         for output in self.batch(
    301             batch, config=config, return_exceptions=return_exceptions, **kwargs
    302         )
    303     ]

File [/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:273](https://file+.vscode-resource.vscode-cdn.net/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/llms/base.py:273), in BaseLLM.batch(self, inputs, config, return_exceptions, **kwargs)
    270 if not inputs:
    271     return []
--> 273 config = get_config_list(config, len(inputs))
    274 max_concurrency = config[0].get("max_concurrency")
    276 if max_concurrency is None:

File [/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/schema/runnable/config.py:118](https://file+.vscode-resource.vscode-cdn.net/usr/local/Caskroom/miniconda/base/envs/chatgpt/lib/python3.9/site-packages/langchain/schema/runnable/config.py:118), in get_config_list(config, length)
    116     raise ValueError(f"length must be >= 0, but got {length}")
    117 if isinstance(config, list) and len(config) != length:
--> 118     raise ValueError(
    119         f"config must be a list of the same length as inputs, "
    120         f"but got {len(config)} configs for {length} inputs"
    121     )
    123 return (
    124     list(map(ensure_config, config))
    125     if isinstance(config, list)
    126     else [patch_config(config, copy_locals=True) for _ in range(length)]
    127 )

ValueError: config must be a list of the same length as inputs, but got 2 configs for 1 inputs
```

Similar errors for `abatch` with `max_concurrecy`.

I believe the bug lies in https://github.com/langchain-ai/langchain/blob/f94e24dfd79ccf55a14641b6940a706674c070f8/libs/langchain/langchain/llms/base.py#L297 where `config` list length is inconsistent with the `inputs` length after chopping up by max_concurrency. The fix could be as simple as
```
config = {**config[0], "max_concurrency": None}  # no list is needed
```

### Expected behavior

No error, just like with `chat_models`