Skip to content

Commit 37b7368

Browse files
committed
uv support and rag, fastmode toggle
1 parent 481fbbf commit 37b7368

File tree

11 files changed

+730
-173
lines changed

11 files changed

+730
-173
lines changed

CHANGELOG.md

Lines changed: 31 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111
- Planned:
12-
- **Plan / Code modes** in interactive CLI (explicit planning vs coding flows for complex tasks).
12+
- **Plan / Code modes** in interactive CLI (explicit "planning" vs "coding" flows for complex tasks).
1313
- First‑class support for **open‑source models via third‑party providers** (e.g. OpenRouter, Groq and similar gateways), alongside existing Ollama + cloud integrations.
1414

1515
### Changed
@@ -20,87 +20,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
---
2222

23-
## [0.1.0] - 2025-11-26
23+
## [0.1.1] - 2025-11-27
24+
25+
### Added
26+
- **UV Support**: Full support for `uv` as an alternative to `python -m venv` for creating virtual environments. Documentation updated to recommend `uv` as the primary method.
27+
- **Performance Toggles**: New `/fast-mode [on|off]`, `/disable-rag`, and `/enable-rag` commands for controlling RAG indexing and response speed. Performance settings now visible in welcome screen and `/status` command.
28+
- **Venv Detection**: Automatic detection of virtual environment in project root with startup warnings if missing.
29+
30+
### Changed
31+
- Welcome screen now displays RAG Mode and Fast Mode status with context-aware tips.
32+
- Code execution prefers Python from project's `.venv/bin/python` when available.
33+
- Documentation updated to recommend `uv` as the primary installation method.
34+
35+
---
2436

25-
### Overview
26-
- **First public release** of DSPy Code: an AI-powered, interactive development and optimization assistant for DSPy (think "Claude Code for DSPy").
37+
## [0.1.0] - 2025-11-26
2738

2839
### Added
29-
- **Interactive CLI & Workflows**
30-
- Rich TUI with animated thinking indicators, status panels, and history-aware prompts.
31-
- Fully conversational flow: describe what you want in natural language, get DSPy code, ask follow‑ups.
32-
- Two core workflows:
33-
- **Development**: `/init` → describe task → generate → `/validate``/run` → iterate.
34-
- **Optimization**: `/data``/optimize``/eval``/export`.
35-
- **Model Connection & Providers**
36-
- Support for local **Ollama** models.
37-
- Cloud providers: **OpenAI**, **Anthropic (Claude)**, **Google Gemini**.
38-
- New interactive `/model` command:
39-
- Auto-detect and list Ollama models, pick by number.
40-
- Cloud flow to pick provider, then type model name (e.g. `gpt-5-nano`, `claude-sonnet-4.5`, `gemini-2.5-flash`).
41-
- Direct `/connect <provider> <model>` command for advanced users.
42-
- `/models`, `/status`, `/disconnect` for model management.
43-
- **LLM Integration & SDK Support**
44-
- OpenAI integration compatible with `openai>=2.x` chat completions API.
45-
- Anthropic integration via the current `anthropic` Python SDK.
46-
- Gemini integration via the official `google-genai` SDK, with fallback to `google-generativeai` when present.
47-
- Local Ollama integration with configurable HTTP timeouts for large models (`OLLAMA_HTTP_TIMEOUT`, `OLLAMA_TEST_TIMEOUT`).
48-
- Optional extras in `pyproject.toml`:
49-
- `dspy-code[openai]`, `dspy-code[anthropic]`, `dspy-code[gemini]`, `dspy-code[llm-all]`.
50-
- **DSPy-Aware Code Generation**
51-
- Natural language → DSPy **Signatures**, **Modules**, and full **Programs**.
52-
- Support for major DSPy patterns: predictors, ChainOfThought, ReAct, RAG, etc.
53-
- Templates and examples for:
54-
- RAG systems
55-
- Question answering
56-
- Classification (e.g. sentiment analyzer)
57-
- Optimization/evaluation workflows
58-
- **Validation & Execution**
59-
- `/validate` to check generated code against DSPy best practices and structure.
60-
- `/run` and `/test` to execute and test generated programs within a sandboxed engine.
61-
- Validation support for signatures, modules, predictors, adapters, metrics, and anti‑patterns.
62-
- **GEPA Optimization**
63-
- End‑to‑end optimization workflows:
64-
- `/optimize` for one‑shot optimization scripts.
65-
- `/optimize-start`, `/optimize-status`, `/optimize-resume`, `/optimize-cancel` for long‑running GEPA jobs.
66-
- Integration with evaluation metrics (Accuracy, F1, ROUGE, BLEU, etc.).
67-
- Documentation and warnings about cloud costs and recommended hardware (32 GB RAM for heavy local optimization).
68-
- **MCP (Model Context Protocol) Integration**
69-
- Built‑in MCP client with commands:
70-
- `/mcp-connect`, `/mcp-disconnect`, `/mcp-servers`, `/mcp-tools`, `/mcp-call`, `/mcp-resources`, `/mcp-read`, `/mcp-prompts`, `/mcp-prompt`.
71-
- Enables connecting DSPy Code to external tools and data sources.
72-
- **Project & Session Management**
73-
- `/init` and `/project` for initializing and inspecting DSPy projects.
74-
- Codebase indexing and RAG support for answering questions about your own code.
75-
- Session management commands: `/sessions`, `/session`, `/history`, `/clear`, `/save-data`, export/import.
76-
- Export/import of sessions and packages for deployment via `/export` and `/import`.
77-
- **Documentation & Examples**
78-
- Full docs site (MkDocs Material) with:
79-
- Getting Started (installation, quick start, first program, understanding DSPy Code).
80-
- Guides (model connection, interactive mode, natural language commands, optimization, project management, validation, slash commands).
81-
- Tutorials (RAG system, question answering, sentiment analyzer, GEPA optimization).
82-
- Reference (commands, configuration, templates, troubleshooting, FAQ, security).
83-
- Homepage and README aligned around DSPy Code as:
84-
- **Development assistant** (build DSPy apps quickly).
85-
- **Optimization engine** (real GEPA).
86-
- **Learning environment** for DSPy concepts.
40+
- **Interactive CLI**: Rich TUI with natural language interface for generating DSPy Signatures, Modules, and Programs. Core workflows: development (`/init` → generate → `/validate``/run`) and optimization (`/data``/optimize``/eval`).
41+
- **Model Support**: Local Ollama models and cloud providers (OpenAI, Anthropic, Gemini) with interactive `/model` command for easy connection. SDK support via optional extras: `dspy-code[openai]`, `dspy-code[anthropic]`, `dspy-code[gemini]`, `dspy-code[llm-all]`.
42+
- **Code Generation**: Natural language to DSPy code with support for major patterns (ChainOfThought, ReAct, RAG, etc.) and templates for common use cases.
43+
- **Validation & Execution**: `/validate` for code checks, `/run` and `/test` for sandboxed execution.
44+
- **GEPA Optimization**: End-to-end optimization workflows with `/optimize` commands and evaluation metrics integration.
45+
- **MCP Integration**: Built-in MCP client for connecting to external tools and data sources.
46+
- **Project Management**: `/init`, codebase indexing, RAG support, session management, and export/import functionality.
47+
- **Documentation**: Complete docs site (MkDocs Material) with getting started guides, tutorials, and reference documentation.
8748

8849
### Changed
89-
- Default Ollama generation timeout increased to 120 seconds to better support large models.
90-
- Examples across README and docs updated to use modern models (e.g. `gpt-5-nano`, `claude-sonnet-4.5`, `gemini-2.5-flash`, `gpt-oss:120b`) and to recommend `/model` as the primary way to connect.
91-
- Quick Start and model‑connection docs now make model connection mandatory and show clear virtual‑env + provider‑SDK installation flows using `dspy-code[...]` extras and `uv`/`pip`.
92-
- Interactive UI improved with modern Rich versions and a `DSPY_CODE_SIMPLE_UI` mode for environments with limited emoji/spinner support.
93-
- Natural language intent routing in interactive mode refined to:
94-
- Prefer natural‑language answers for questions.
95-
- Avoid double code generation and incorrect `/explain` follow‑ups.
96-
- MkDocs navigation configuration tuned (tabs, sections) to keep the left nav stable and highlight the active page correctly.
50+
- Default Ollama timeout increased to 120 seconds for large models.
51+
- Examples updated to use modern models (`gpt-5-nano`, `claude-sonnet-4.5`, `gemini-2.5-flash`).
52+
- Interactive UI improved with Rich library and `DSPY_CODE_SIMPLE_UI` mode for limited emoji support.
53+
- Natural language routing refined to prefer answers for questions and avoid duplicate code generation.
9754

9855
### Fixed
99-
- OpenAI deprecation issues (`APIRemovedInV1`) by migrating from `ChatCompletion` to the new client API, and removing unsupported `max_tokens`/`temperature` parameters for models like `gpt-5-nano`.
100-
- Interactive mode errors:
101-
- `name 'explanations' is not defined` during `/explain`.
102-
- Syntax errors in `nl_command_router` debug logging.
103-
- Ollama timeout handling for large models, with clearer error messages on connection/generation failures.
104-
- Documentation glitches:
105-
- Stray `\n` in callouts.
106-
- Navigation behavior that caused pages to disappear or not highlight correctly.
56+
- OpenAI SDK migration to new client API, removed unsupported parameters for newer models.
57+
- Interactive mode errors (`name 'explanations' is not defined`, syntax errors).
58+
- Ollama timeout handling and error messages.
59+
- Documentation formatting and navigation issues.

docs/getting-started/installation.md

Lines changed: 60 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,38 @@ cd my-dspy-project
3131

3232
### Step 2: Create Virtual Environment IN This Directory
3333

34-
```bash
35-
# Create .venv INSIDE your project directory (not elsewhere!)
36-
python -m venv .venv
34+
=== "uv (Recommended)"
3735

38-
# Activate it
39-
# For bash/zsh (macOS/Linux):
40-
source .venv/bin/activate
41-
# For fish shell:
42-
source .venv/bin/activate.fish
43-
# On Windows:
44-
.venv\Scripts\activate
45-
```
36+
```bash
37+
# Create .venv INSIDE your project directory (not elsewhere!)
38+
uv venv
39+
40+
# Activate it
41+
# For bash/zsh (macOS/Linux):
42+
source .venv/bin/activate
43+
# For fish shell:
44+
source .venv/bin/activate.fish
45+
# On Windows:
46+
.venv\Scripts\activate
47+
```
48+
49+
=== "python -m venv"
50+
51+
```bash
52+
# Create .venv INSIDE your project directory (not elsewhere!)
53+
python -m venv .venv
54+
55+
# Activate it
56+
# For bash/zsh (macOS/Linux):
57+
source .venv/bin/activate
58+
# For fish shell:
59+
source .venv/bin/activate.fish
60+
# On Windows:
61+
.venv\Scripts\activate
62+
```
63+
64+
!!! tip "Why uv?"
65+
`uv` is a fast Python package manager written in Rust. It's 10-100x faster than pip and provides better dependency resolution. [Learn more about uv](https://docs.astral.sh/uv/)
4666

4767
!!! success "Why .venv in the Project?"
4868
When you create the virtual environment inside your project:
@@ -55,39 +75,42 @@ source .venv/bin/activate.fish
5575

5676
### Step 3: Install DSPy Code
5777

58-
=== "pip"
78+
=== "uv (Recommended)"
5979

6080
```bash
6181
# This installs into .venv/ in your project
62-
pip install --upgrade dspy-code
63-
```
64-
65-
=== "uv"
66-
67-
```bash
68-
# If you use uv, you can install dspy-code like this
6982
uv pip install --upgrade dspy-code
7083

7184
# Or add it to your project dependencies (pyproject.toml) in one step
7285
uv add dspy-code
7386
```
7487

88+
=== "pip"
89+
90+
```bash
91+
# This installs into .venv/ in your project
92+
pip install --upgrade dspy-code
93+
```
94+
7595
That's it! DSPy Code is now installed in your project.
7696

7797
### Step 4: Install DSPy (Optional)
7898

7999
DSPy Code will install DSPy automatically if needed, but you can install/upgrade it explicitly:
80100

81-
=== "pip"
101+
!!! tip "Use the same tool you used for venv"
102+
If you created your venv with `uv venv`, use `uv pip install` for consistency. If you used `python -m venv`, use `pip install`.
103+
104+
=== "uv (Recommended)"
82105

83106
```bash
84-
pip install --upgrade dspy
107+
uv pip install --upgrade dspy
85108
```
86109

87-
=== "uv"
110+
=== "pip"
88111

89112
```bash
90-
uv pip install --upgrade dspy
113+
pip install --upgrade dspy
91114
```
92115

93116
!!! info "DSPy Version"
@@ -156,38 +179,41 @@ DSPy Code has optional dependencies for different features. Install only what yo
156179

157180
### Cloud Model Providers (via dspy-code extras)
158181

159-
Use extras so versions stay aligned with dspy-codes tested matrix.
182+
Use extras so versions stay aligned with dspy-code's tested matrix.
160183

161-
=== "pip"
184+
!!! tip "Use the same tool you used for venv"
185+
If you created your venv with `uv venv`, use `uv pip install` for consistency. If you used `python -m venv`, use `pip install`.
186+
187+
=== "uv (Recommended)"
162188

163189
```bash
164190
# OpenAI support
165-
pip install "dspy-code[openai]"
191+
uv pip install "dspy-code[openai]"
166192

167193
# Google Gemini support
168-
pip install "dspy-code[gemini]"
194+
uv pip install "dspy-code[gemini]"
169195

170196
# Anthropic (paid key required)
171-
pip install "dspy-code[anthropic]"
197+
uv pip install "dspy-code[anthropic]"
172198

173199
# Or install all cloud providers at once
174-
pip install "dspy-code[llm-all]"
200+
uv pip install "dspy-code[llm-all]"
175201
```
176202

177-
=== "uv"
203+
=== "pip"
178204

179205
```bash
180206
# OpenAI support
181-
uv pip install "dspy-code[openai]"
207+
pip install "dspy-code[openai]"
182208

183209
# Google Gemini support
184-
uv pip install "dspy-code[gemini]"
210+
pip install "dspy-code[gemini]"
185211

186212
# Anthropic (paid key required)
187-
uv pip install "dspy-code[anthropic]"
213+
pip install "dspy-code[anthropic]"
188214

189215
# Or install all cloud providers at once
190-
uv pip install "dspy-code[llm-all]"
216+
pip install "dspy-code[llm-all]"
191217
```
192218

193219
> **Note:** Anthropic has discontinued free API keys. DSPy Code fully supports Claude **if you already have a paid API key**, but Anthropic integration will simply not work without one.

docs/getting-started/quick-start.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ mkdir my-dspy-project
1212
cd my-dspy-project
1313

1414
# 2. Create a virtual environment INSIDE this directory
15-
python -m venv .venv
15+
# Recommended: Use uv (faster and more reliable)
16+
uv venv
17+
18+
# Alternative: Use standard Python venv
19+
# python -m venv .venv
1620

1721
# 3. Activate the virtual environment
1822
# For bash/zsh (macOS/Linux):
@@ -23,23 +27,27 @@ source .venv/bin/activate.fish
2327
.venv\Scripts\activate
2428

2529
# 4. Install dspy-code (always upgrade for latest features)
26-
pip install --upgrade dspy-code
30+
# Recommended: Use uv
31+
uv pip install --upgrade dspy-code
32+
33+
# Alternative: Use pip
34+
# pip install --upgrade dspy-code
2735

2836
# 5. (Optional but recommended) Install provider SDKs via dspy-code extras
2937

3038
# If you ONLY want local models (Ollama), you can skip this step.
3139

32-
# OpenAI support
33-
pip install "dspy-code[openai]"
34-
35-
# Google Gemini support
36-
pip install "dspy-code[gemini]"
37-
38-
# Anthropic (paid key required)
39-
pip install "dspy-code[anthropic]"
40-
41-
# Or install all cloud providers at once
42-
pip install "dspy-code[llm-all]"
40+
# If using uv (recommended):
41+
uv pip install "dspy-code[openai]" # OpenAI support
42+
uv pip install "dspy-code[gemini]" # Google Gemini support
43+
uv pip install "dspy-code[anthropic]" # Anthropic (paid key required)
44+
uv pip install "dspy-code[llm-all]" # Or install all cloud providers at once
45+
46+
# If using pip:
47+
# pip install "dspy-code[openai]"
48+
# pip install "dspy-code[gemini]"
49+
# pip install "dspy-code[anthropic]"
50+
# pip install "dspy-code[llm-all]"
4351
```
4452

4553
For more details, see the [Installation Guide](installation.md).

0 commit comments

Comments
 (0)