-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
Checked other resources
- This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
- I added a clear and descriptive title that summarizes this issue.
- I used the GitHub search to find a similar question and didn't find it.
- I am sure that this is a bug in LangChain rather than my code.
- The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
- I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
- I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.
Example Code
llm = ChatOllama(model="gpt-oss:20b", temperature=0)
llm_with_tools = llm.bind_tools(tools=my_tools)
llm_output = llm_with_tools.invoke(user_input)
Error Message and Stack Trace (if applicable)
Exception has occurred: ResponseError
template: :108:130: executing "" at <index $prop.Type 0>: error calling index: reflect: slice index out of range (status code: 500)
httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'http://127.0.0.1:11434/api/chat'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
Description
I am trying to use recently released "gpt-oss:20b" model from OpenAI. I am able to host the model locally with Ollama and it's working from console. But when I tried integrating the model into langchain, getting exception. llm_with_tools.invoke throws the exception.
System Info
absl-py==1.4.0
aiohappyeyeballs==2.6.1
aiohttp==3.12.14
aiosignal==1.4.0
alembic==1.11.1
annotated-types==0.7.0
anyio==4.8.0
asttokens==2.2.1
astunparse==1.6.3
async-timeout==4.0.2
attrs==23.1.0
backcall==0.2.0
banal==1.0.6
bertopic==0.16.4
blis==0.7.9
cachetools==5.3.0
catalogue==2.0.8
certifi==2023.5.7
chardet==5.2.0
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
comm==0.1.3
confection==0.0.4
contourpy==1.0.7
cycler==0.11.0
cymem==2.0.7
dataclasses-json==0.6.7
dataset==1.6.0
datasets==2.12.0
debugpy==1.6.7
decorator==5.1.1
dill==0.3.6
distro==1.9.0
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.5.0/en_core_web_sm-3.5.0-py3-none-any.whl#sha256=0964370218b7e1672a30ac50d72c
dc6b16f7c867496f1d60925691188f4d2510
evaluate==0.4.0
exceptiongroup==1.2.2
executing==1.2.0
filelock==3.12.0
filetype==1.2.0
flatbuffers==23.5.9
fonttools==4.39.3
frozenlist==1.3.3
fsspec==2023.5.0
gast==0.4.0
gensim==4.3.1
google-ai-generativelanguage==0.6.18
google-api-core==2.25.1
google-auth==2.18.1
google-auth-oauthlib==1.0.0
google-pasta==0.2.0
googleapis-common-protos==1.70.0
grandalf==0.8
greenlet==2.0.2
grpcio==1.74.0
grpcio-status==1.74.0
h11==0.14.0
h5py==3.8.0
hdbscan==0.8.40
httpcore==1.0.7
httpx==0.28.1
httpx-sse==0.4.0
huggingface-hub==0.14.1
idna==3.4
importlib-metadata==6.6.0
importlib-resources==5.12.0
ipykernel==6.22.0
ipython==8.12.0
jax==0.4.10
jedi==0.18.2
Jinja2==3.1.2
jiter==0.8.2
joblib==1.2.0
jsonpatch==1.33
jsonpointer==3.0.0
jsonschema==4.24.0
jsonschema-path==0.3.4
jsonschema-specifications==2025.4.1
jupyter_client==8.2.0
jupyter_core==5.3.0
keras==2.12.0
kiwisolver==1.4.4
langchain==0.3.27
langchain-community==0.3.27
langchain-core==0.3.72
langchain-google-genai==2.1.8
langchain-ollama==0.3.2
langchain-tavily==0.2.7
langchain-text-splitters==0.3.9
langchainhub==0.1.21
langcodes==3.3.0
langgraph==0.6.1
langgraph-checkpoint==2.1.0
langgraph-prebuilt==0.6.1
langgraph-sdk==0.2.0
langsmith==0.4.8
lazy-object-proxy==1.11.0
libclang==16.0.0
lightgbm==3.3.5
llvmlite==0.43.0
Mako==1.2.4
Markdown==3.4.3
markdown-it-py==3.0.0
MarkupSafe==2.1.2
marshmallow==3.26.1
matplotlib==3.7.1
matplotlib-inline==0.1.6
mdurl==0.1.2
ml-dtypes==0.1.0
mpmath==1.3.0
multidict==6.0.4
multiprocess==0.70.14
murmurhash==1.0.9
mypy_extensions==1.1.0
narwhals==1.27.1
nest-asyncio==1.5.6
networkx==3.1
nltk==3.8.1
numba==0.60.0
numpy==2.0.2
oauthlib==3.2.2
ollama==0.4.8
openai==1.63.2
openapi-pydantic==0.5.1
openapi-schema-validator==0.6.3
openapi-spec-validator==0.7.2
openapi3-parser==1.1.21
opt-einsum==3.3.0
orjson==3.10.18
ormsgpack==1.10.0
packaging==24.2
pandas==2.0.0
parso==0.8.3
pathable==0.4.4
pathy==0.10.2
pickleshare==0.7.5
Pillow==9.5.0
platformdirs==3.2.0
plotly==6.0.0
prance==23.6.21.0
preshed==3.0.8
prompt-toolkit==3.0.38
propcache==0.3.2
proto-plus==1.26.1
protobuf==6.31.1
psutil==5.9.5
pure-eval==0.2.2
pyarrow==12.0.0
pyasn1==0.5.0
pyasn1-modules==0.3.0
pydantic==2.11.7
pydantic-settings==2.9.1
pydantic_core==2.33.2
Pygments==2.15.1
pynndescent==0.5.13
pyparsing==3.0.9
python-dateutil==2.8.2
python-dotenv==1.1.0
pytz==2023.3
pywin32==306
PyYAML==6.0
pyzmq==25.0.2
referencing==0.36.2
regex==2023.3.23
requests==2.32.4
requests-oauthlib==1.3.1
requests-toolbelt==1.0.0
responses==0.18.0
rfc3339-validator==0.1.4
rich==14.0.0
rpds-py==0.26.0
rsa==4.9
ruamel.yaml==0.18.14
ruamel.yaml.clib==0.2.12
scikit-learn==1.2.2
scipy==1.10.1
seaborn==0.12.2
sentence-transformers==2.2.2
sentencepiece==0.1.99
setfit @ git+https://github.com/pmbaumgartner/setfit@e7df755d8233436b14bf6805751429fda4a4485b
six==1.16.0
smart-open==6.3.0
sniffio==1.3.1
spacy==3.5.3
spacy-legacy==3.0.12
spacy-loggers==1.0.4
SQLAlchemy==1.4.48
srsly==2.4.6
stack-data==0.6.2
sympy==1.12
tabulate==0.9.0
tenacity==9.1.2
tensorboard==2.12.3
tensorboard-data-server==0.7.0
tensorflow==2.12.0
tensorflow-estimator==2.12.0
tensorflow-intel==2.12.0
tensorflow-io-gcs-filesystem==0.31.0
termcolor==2.3.0
thinc==8.1.10
threadpoolctl==3.1.0
tokenizers==0.13.3
torch==1.13.1
torchvision==0.14.1
tornado==6.3.1
tqdm==4.65.0
traitlets==5.9.0
transformers==4.29.2
typer==0.7.0
types-requests==2.32.0.20250515
typing-inspect==0.9.0
typing-inspection==0.4.0
typing_extensions==4.12.2
tzdata==2023.3
umap-learn==0.5.7
urllib3==1.26.20
wasabi==1.1.2
wcwidth==0.2.6
Werkzeug==2.3.4
wrapt==1.14.1
xxhash==3.5.0
yarl==1.20.1
zipp==3.15.0
zstandard==0.23.0