Skip to content

Local lm revamp - #39

Merged
krypticmouse merged 3 commits into
mainfrom
local-lm-revamp
Oct 26, 2025
Merged

Local lm revamp#39
krypticmouse merged 3 commits into
mainfrom
local-lm-revamp

Conversation

@krypticmouse

Copy link
Copy Markdown
Owner

This pull request updates the dspy-rs crate and its documentation to version 0.7.1, introduces a new builder-based API for configuring language models (LMs), and expands support for additional LM providers. The changes simplify LM configuration, improve environment variable handling, and remove the legacy LMConfig struct. Several example files and core modules are refactored to use the new builder API, and provider support is updated to include Ollama and OpenRouter.

Language Model Configuration & API Improvements

  • Refactored LM configuration to use a builder pattern (LM::builder()) instead of the previous LMConfig struct, simplifying model setup and enabling async building. All examples and documentation now use this approach. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • Removed the LMConfig struct and its usage from the codebase, consolidating all configuration logic into the builder API. [1] [2]

Provider Support Expansion

  • Updated the LM client registry to remove Cohere and Perplexity providers, and added support for Ollama and OpenRouter. The enum LMClient and its construction logic were refactored accordingly. [1] [2] [3] [4] [5] [6]
  • Enhanced provider construction with improved environment variable handling and new methods for OpenAI-compatible and local providers. Error messages for unsupported providers are now more informative.

Documentation & Version Updates

  • Updated all documentation and example code to reflect the new builder API and version bump to 0.7.1. [1] [2]

Internal API Changes

  • Changed cache access in ChatAdapter from lm.config.cache to lm.cache to match the new LM struct. [1] [2]
  • Cleaned up imports in examples to remove unused LMConfig. [1] [2]

These changes modernize the LM configuration workflow, make it easier to add new providers, and improve the developer experience for users of the dspy-rs crate.

@krypticmouse
krypticmouse merged commit 7d8db7b into main Oct 26, 2025
10 checks passed
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