Skip to content

Conversation

@elusznik
Copy link

This pull request adds full support for OpenRouter's reasoning features, enabling seamless translation between Claude's thinking parameter and OpenRouter's reasoning parameter. The changes ensure bidirectional mapping in both requests and responses, including real-time streaming of reasoning tokens. Smart defaults are provided for reasoning when parameters are missing, and the system is now compatible with Claude Code and OpenRouter reasoning models.

Reasoning support and bidirectional mapping:

  • Added support for mapping Claude's thinking block to OpenRouter's reasoning parameter in requests, and vice versa in responses, including handling of reasoning tokens in streaming and non-streaming modes. [1] [2] [3] [4]

Streaming enhancements:

  • Implemented logic to stream reasoning tokens as thinking_delta events, enabling real-time visualization of model reasoning in compatible tools.
  • Updated streaming logic to correctly manage content block transitions when reasoning or thinking tokens are present, ensuring proper start/stop events for each block type. [1] [2] [3] [4]

Smart defaults and backward compatibility:

  • Introduced smart defaults for reasoning (defaults to effort: 'high' if no reasoning/thinking provided) and retained backward compatibility for the reasoning_effort parameter.

Documentation updates:

  • Updated README.md to document OpenRouter reasoning support, including bidirectional mapping, streaming, and smart defaults.

…equests and process reasoning content in responses.
…endency; add tsconfig.json for TypeScript configuration
…c stream conversion, and add corresponding test files.
… default Claude Code settings.json alone. update installation instructions for local development and proxy usage, remove hosted install options, and refine UI elements.
…d improve backup handling by preventing backup overwrites.
…n, and update .gitignore to exclude Gemini files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant