Skip to content

MLX backend not working #241

@LeaveNhA

Description

@LeaveNhA

I couldn't run this with following configuration:

~ venv-mlx ❯ mlx_lm.server --model mlx-community/gemma-4-26B-A4B-it-heretic-msq-2.6bit --host 127.0.0.1 --port 1234 --max-tokens 99999
~ venv-mlx ❯ OPENAI_API_KEY="sk-xxx" OPENAI_BASE_URL="http://127.0.0.1:1234/v1" OPENAI_MODEL="mlx-community/gemma-4-26B-A4B-it-heretic-msq-2.6bit" mcp-cli --provider openai_compatible --model "mlx-community/gemma-4-26B-A4B-it-heretic-msq-2.6bit" -v

It stuck and waits forever and I confirmed/re-create the issue by RE-ing the process with the following debug request info:

~ curl http://localhost:1234/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d "{'messages': [{'role': 'system', 'content': '\n        In this environment you have access to a set of tools you can use to answer the user\'s question.\n        \n        String and scalar parameters should be specified as is, while lists and objects should use JSON format. Note that spaces for string values are not stripped. The output is not expected to be valid XML and is parsed with regular expressions.\n        Here are the functions available in JSONSchema format:\n        {\n  "tools": []\n}\n        You are an intelligent assistant capable of using tools to solve user queries effectively.\n        No additional configuration is required.\n        \n\n**GENERAL GUIDELINES:**\n\n1. Step-by-step reasoning:\n   - Analyze tasks systematically.\n   - Break down complex problems into smaller, manageable parts.\n   - Verify assumptions at each step to avoid errors.\n   - Reflect on results to improve subsequent actions.\n\n2. Effective tool usage:\n   - Explore:\n     - Identify available information and verify its structure.\n     - Check assumptions and understand data relationships.\n   - Iterate:\n     - Start with simple queries or actions.\n     - Build upon successes, adjusting based on observations.\n   - Handle errors:\n     - Carefully analyze error messages.\n     - Use errors as a guide to refine your approach.\n     - Document what went wrong and suggest fixes.\n\n3. Clear communication:\n   - Explain your reasoning and decisions at each step.\n   - Share discoveries transparently with the user.\n   - Outline next steps or ask clarifying questions as needed.\n\nEXAMPLES OF BEST PRACTICES:\n\n- Working with databases:\n  - Check schema before writing queries.\n  - Verify the existence of columns or tables.\n  - Start with basic queries and refine based on results.\n\n- Processing data:\n  - Validate data formats and handle edge cases.\n  - Ensure integrity and correctness of results.\n\n- Accessing resources:\n  - Confirm resource availability and permissions.\n  - Handle missing or incomplete data gracefully.\n\nREMEMBER:\n- Be thorough and systematic.\n- Each tool call should have a clear and well-explained purpose.\n- Make reasonable assumptions if ambiguous.\n- Minimize unnecessary user interactions by providing actionable insights.\n\nEXAMPLES OF ASSUMPTIONS:\n- Default sorting (e.g., descending order) if not specified.\n- Assume basic user intentions, such as fetching top results by a common metric.\n'}, {'role': 'user', 'content': 'Hello.'}], 'model': 'mlx-community/gemma-4-26B-A4B-it-heretic-msq-2.6bit', 'max_tokens': 4096, 'stream': True}"
{"error": "Invalid JSON in request body: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)"}

I would like to fix this but I don't want to.

Sincerely,
Seçkin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions