Skip to content

[Docs]: Setting up custom LLMs #1500

Description

@vsubbaramu

Documentation Type

Missing documentation

Documentation Location

I am trying to setup cognee for using the qwen/qwen3-4b-2507 via the Lm Studio. I was able to configure the lm studio to use open ai like endpoint http://localhost:1234/v1. I have configured the ,env in the cognee project directory to the following values
LLM_PROVIDER="custom"
LLM_MODEL="lm_studio/qwen/qwen3-4b-2507"
LLM_ENDPOINT="http://localhost:1234/v1"
LLM_API_KEY="lm-studio"
LITELLM_RESPONSE_FORMAT_TYPE=text

Optional fallback chain

FALLBACK_MODEL=

FALLBACK_ENDPOINT=

FALLBACK_API_KEY=

the code is a simple extract as below

import asyncio
import cognee

custom_prompt = """
Extract only people and cities as entities.
Connect people to cities with the relationship "lives_in".
Ignore all other entities.
"""

async def main():
await cognee.add([
"Alice moved to Paris in 2010, while Bob has always lived in New York.",
"Andreas was born in Venice, but later settled in Lisbon.",
"Diana and Tom were born and raised in Helsingy. Diana currently resides in Berlin, while Tom never moved."
])

if name == "main":
asyncio.run(main())

This always results in the following error

litellm.BadRequestError: Lm_studioException - Error code: 400 - {'error': "'response_format.type' must be 'json_schema' or 'text'"}

Is there any other configuration that I am missing here .Kindly advise.

Regards

Issue Description

There isnt much information about custom localllms.

Suggested Improvement

By including additional instructions if any.

Additional Context

No response

Pre-submission Checklist

  • I have searched existing issues to ensure this documentation issue hasn't been reported already
  • I have provided a clear description of the documentation issue
  • I have specified the location of the documentation issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions