Files
opro_demo/config.py
leehwui 1376d60ed5 feat: implement true OPRO with Gemini-style UI
- Add true OPRO system instruction optimization (vs query rewriting)
- Implement iterative optimization with performance trajectory
- Add new OPRO API endpoints (/opro/create, /opro/generate_and_evaluate, /opro/execute)
- Create modern Gemini-style chat UI (frontend/opro.html)
- Optimize performance: reduce candidates from 20 to 10 (2x faster)
- Add model selector in UI toolbar
- Add collapsible sidebar with session management
- Add copy button for instructions
- Ensure all generated prompts use simplified Chinese
- Update README with comprehensive documentation
- Add .gitignore for local_docs folder
2025-12-06 17:24:28 +08:00

21 lines
753 B
Python

APP_TITLE = "OPRO Prompt Optimizer API"
APP_DESCRIPTION = "提供提示优化、候选生成、会话聊天与模型管理的接口"
APP_VERSION = "0.1.0"
APP_CONTACT = {"name": "OPRO Team", "url": "http://127.0.0.1:8010/ui/"}
# Ollama endpoints
OLLAMA_HOST = "http://127.0.0.1:11434"
OLLAMA_GENERATE_URL = f"{OLLAMA_HOST}/api/generate"
OLLAMA_TAGS_URL = f"{OLLAMA_HOST}/api/tags"
DEFAULT_CHAT_MODEL = "qwen3:8b"
DEFAULT_EMBED_MODEL = "qwen3-embedding:4b"
# Xinference
XINFERENCE_EMBED_URL = "http://127.0.0.1:9997/models/bge-base-zh/embed"
# Clustering/selection
GENERATION_POOL_SIZE = 10 # Generate this many candidates before clustering
TOP_K = 5 # Return this many diverse candidates to user
CLUSTER_DISTANCE_THRESHOLD = 0.15