Skip to content

Commit eae3d67

Browse files
authored
Merge branch 'main' into LCORE_945_optional_topic_summary
2 parents a13b239 + db45d8c commit eae3d67

213 files changed

Lines changed: 26744 additions & 1524 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
language: en-US
2+
tone_instructions: ''
3+
early_access: false
4+
enable_free_tier: true
5+
reviews:
6+
profile: chill
7+
request_changes_workflow: false
8+
high_level_summary: true
9+
high_level_summary_placeholder: '@coderabbitai summary'
10+
high_level_summary_in_walkthrough: false
11+
auto_title_placeholder: '@coderabbitai'
12+
auto_title_instructions: ''
13+
review_status: true
14+
commit_status: true
15+
fail_commit_status: false
16+
collapse_walkthrough: false
17+
changed_files_summary: true
18+
sequence_diagrams: true
19+
estimate_code_review_effort: true
20+
assess_linked_issues: true
21+
related_issues: true
22+
related_prs: true
23+
suggested_labels: true
24+
labeling_instructions: []
25+
auto_apply_labels: false
26+
suggested_reviewers: true
27+
auto_assign_reviewers: false
28+
in_progress_fortune: true
29+
poem: false
30+
path_filters: []
31+
path_instructions: []
32+
abort_on_close: true
33+
disable_cache: false
34+
auto_review:
35+
enabled: true
36+
auto_incremental_review: true
37+
ignore_title_keywords: []
38+
labels: []
39+
drafts: false
40+
base_branches: []
41+
ignore_usernames: []
42+
finishing_touches:
43+
docstrings:
44+
enabled: true
45+
unit_tests:
46+
enabled: true
47+
pre_merge_checks:
48+
docstrings:
49+
mode: warning
50+
threshold: 80
51+
title:
52+
mode: warning
53+
requirements: ''
54+
description:
55+
mode: warning
56+
issue_assessment:
57+
mode: warning
58+
custom_checks: []
59+
tools:
60+
ast-grep:
61+
rule_dirs: []
62+
util_dirs: []
63+
essential_rules: true
64+
packages: []
65+
shellcheck:
66+
enabled: true
67+
ruff:
68+
enabled: true
69+
markdownlint:
70+
enabled: true
71+
github-checks:
72+
enabled: true
73+
timeout_ms: 90000
74+
languagetool:
75+
enabled: true
76+
enabled_rules: []
77+
disabled_rules: []
78+
enabled_categories: []
79+
disabled_categories: []
80+
enabled_only: false
81+
level: default
82+
biome:
83+
enabled: true
84+
hadolint:
85+
enabled: true
86+
swiftlint:
87+
enabled: true
88+
phpstan:
89+
enabled: true
90+
level: default
91+
phpmd:
92+
enabled: true
93+
phpcs:
94+
enabled: true
95+
golangci-lint:
96+
enabled: true
97+
yamllint:
98+
enabled: true
99+
gitleaks:
100+
enabled: true
101+
checkov:
102+
enabled: true
103+
detekt:
104+
enabled: true
105+
eslint:
106+
enabled: true
107+
flake8:
108+
enabled: true
109+
rubocop:
110+
enabled: true
111+
buf:
112+
enabled: true
113+
regal:
114+
enabled: true
115+
actionlint:
116+
enabled: true
117+
pmd:
118+
enabled: true
119+
clang:
120+
enabled: true
121+
cppcheck:
122+
enabled: true
123+
semgrep:
124+
enabled: true
125+
circleci:
126+
enabled: true
127+
clippy:
128+
enabled: true
129+
sqlfluff:
130+
enabled: true
131+
prismaLint:
132+
enabled: true
133+
pylint:
134+
enabled: true
135+
oxc:
136+
enabled: true
137+
shopifyThemeCheck:
138+
enabled: true
139+
luacheck:
140+
enabled: true
141+
brakeman:
142+
enabled: true
143+
dotenvLint:
144+
enabled: true
145+
htmlhint:
146+
enabled: true
147+
checkmake:
148+
enabled: true
149+
osvScanner:
150+
enabled: true
151+
chat:
152+
art: true
153+
auto_reply: true
154+
integrations:
155+
jira:
156+
usage: auto
157+
linear:
158+
usage: auto
159+
knowledge_base:
160+
opt_out: false
161+
web_search:
162+
enabled: true
163+
code_guidelines:
164+
enabled: true
165+
filePatterns: []
166+
learnings:
167+
scope: auto
168+
issues:
169+
scope: auto
170+
jira:
171+
usage: auto
172+
project_keys: []
173+
linear:
174+
usage: auto
175+
team_keys: []
176+
pull_requests:
177+
scope: auto
178+
mcp:
179+
usage: auto
180+
disabled_servers: []
181+
code_generation:
182+
docstrings:
183+
language: en-US
184+
path_instructions: []
185+
unit_tests:
186+
path_instructions: []
187+

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Lightspeed Core Stack (LCS) is an AI-powered assistant built on FastAPI that pro
1515
### Project Structure
1616
```
1717
src/
18-
├── app/ # FastAPI application
19-
│ ├── endpoints/ # REST API endpoints
18+
├── app/ # FastAPI application
19+
│ ├── endpoints/ # REST API endpoints
2020
│ └── main.py # Application entry point
21-
├── auth/ # Authentication modules (k8s, jwk, noop)
22-
├── authorization/ # Authorization middleware & resolvers
21+
├── auth/ # Authentication modules (k8s, jwk, noop)
22+
├── authorization/ # Authorization middleware & resolvers
2323
├── models/ # Pydantic models
2424
│ ├── config.py # Configuration classes
2525
│ ├── requests.py # Request models
@@ -110,8 +110,8 @@ src/
110110
### Test Structure
111111
```
112112
tests/
113-
├── unit/ # Unit tests (pytest)
114-
├── integration/ # Integration tests
113+
├── unit/ # Unit tests (pytest)
114+
├── integration/ # Integration tests (pytest)
115115
└── e2e/ # End-to-end tests (behave)
116116
└── features/ # Gherkin feature files
117117
```
@@ -146,7 +146,7 @@ tests/
146146
```bash
147147
uv run make test-unit # Unit tests with coverage
148148
uv run make test-integration # Integration tests
149-
uv run make test-e2e # End-to-end tests
149+
uv run make test-e2e # End-to-end tests
150150
```
151151

152152
## Quality Assurance
@@ -184,4 +184,4 @@ uv run make test-e2e # End-to-end tests
184184
3. **ALWAYS** check `pyproject.toml` for existing dependencies and versions before adding new ones
185185
4. Follow existing code patterns in the module you're modifying
186186
5. Write unit tests covering new functionality
187-
6. Run format and verify before completion
187+
6. Run format and verify before completion

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ PYTHON_REGISTRY = pypi
88
run: ## Run the service locally
99
uv run src/lightspeed_stack.py
1010

11-
12-
1311
test-unit: ## Run the unit tests
1412
@echo "Running unit tests..."
1513
@echo "Reports will be written to ${ARTIFACT_DIR}"
@@ -24,7 +22,7 @@ test-e2e: ## Run end to end tests for the service
2422
script -q -e -c "uv run behave --color --format pretty --tags=-skip -D dump_errors=true @tests/e2e/test_list.txt"
2523

2624
check-types: ## Checks type hints in sources
27-
uv run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --ignore-missing-imports --disable-error-code attr-defined src/ tests/unit
25+
uv run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --ignore-missing-imports --disable-error-code attr-defined src/ tests/unit tests/integration tests/e2e/
2826

2927
security-check: ## Check the project for security issues
3028
bandit -c pyproject.toml -r src tests

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ The service includes comprehensive user data collection capabilities for various
3434
* [Llama Stack version check](#llama-stack-version-check)
3535
* [User data collection](#user-data-collection)
3636
* [System prompt](#system-prompt)
37+
* [System Prompt Path](#system-prompt-path)
38+
* [System Prompt Literal](#system-prompt-literal)
39+
* [Custom Profile](#custom-profile)
3740
* [Control model/provider overrides via authorization](#control-modelprovider-overrides-via-authorization)
3841
* [Safety Shields](#safety-shields)
3942
* [Authentication](#authentication)
@@ -75,6 +78,10 @@ The service includes comprehensive user data collection capabilities for various
7578
* [Project structure](#project-structure)
7679
* [Configuration classes](#configuration-classes)
7780
* [REST API](#rest-api)
81+
* [Sequence diagrams](#sequence-diagrams)
82+
* [Query endpoint REST API handler](#query-endpoint-rest-api-handler)
83+
* [Streaming query endpoint REST API handler](#streaming-query-endpoint-rest-api-handler)
84+
* [Versioning](#versioning)
7885

7986
<!-- vim-markdown-toc -->
8087

@@ -94,6 +101,31 @@ Lightspeed Core Stack is based on the FastAPI framework (Uvicorn). The service i
94101
- please note that currently Python 3.14 is not officially supported
95102
- all sources are made (backward) compatible with Python 3.12; it is checked on CI
96103

104+
* OpenAI API Key (Recommended for Getting Started)
105+
106+
Lightspeed Stack supports multiple LLM providers.
107+
108+
| Provider | Setup Documentation |
109+
|----------------|-----------------------------------------------------------------------|
110+
| OpenAI | https://platform.openai.com |
111+
| Azure OpenAI | https://azure.microsoft.com/en-us/products/ai-services/openai-service |
112+
| RHOAI (vLLM) | See tests/e2e-prow/rhoai/configs/run.yaml |
113+
| RHEL AI (vLLM) | See tests/e2e/configs/run-rhelai.yaml |
114+
115+
See `docs/providers.md` for configuration details.
116+
117+
You will need an API key from one of these providers to run LightSpeed Stack.
118+
119+
For example, if you choose to use OpenAI:
120+
121+
1. **Create an account** at [platform.openai.com](https://platform.openai.com)
122+
2. **Add payment information** (new accounts receive free trial credits)
123+
3. **Generate an API key** from your dashboard at [API Keys](https://platform.openai.com/api-keys)
124+
4. **Export the key** in your environment:
125+
```bash
126+
export OPENAI_API_KEY="sk-your-api-key-here"
127+
```
128+
97129
# Installation
98130

99131
Installation steps depends on operation system. Please look at instructions for your system:
@@ -864,3 +896,22 @@ For complete integration setup, deployment options, and configuration details, s
864896
## REST API
865897
866898
![REST API](docs/rest_api.png)
899+
900+
## Sequence diagrams
901+
902+
### Query endpoint REST API handler
903+
904+
![Query endpoint](docs/query_endpoint.svg)
905+
906+
## Streaming query endpoint REST API handler
907+
908+
![Streaming query endpoint](docs/streaming_query_endpoint.svg)
909+
910+
## Versioning
911+
912+
We follow [Semantic Versioning](http://semver.org/spec/v1.0.0.html).
913+
The version X.Y.Z indicates:
914+
915+
* X is the major version (backward-incompatible),
916+
* Y is the minor version (backward-compatible), and
917+
* Z is the patch version (backward-compatible bug fix).

docs/architecture.png

26.3 KB
Loading

docs/architecture.svg

Lines changed: 349 additions & 32 deletions
Loading

docs/config.png

-698 Bytes
Loading

docs/config.puml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class "Configuration" as src.models.config.Configuration {
3838
authentication : Optional[AuthenticationConfiguration]
3939
authorization : Optional[AuthorizationConfiguration]
4040
byok_rag : Optional[list[ByokRag]]
41-
conversation_cache : Optional[ConversationCacheConfiguration]
41+
conversation_cache : Optional[ConversationHistoryConfiguration]
4242
customization : Optional[Customization]
4343
database : Optional[DatabaseConfiguration]
4444
inference : Optional[InferenceConfiguration]
@@ -53,7 +53,7 @@ class "Configuration" as src.models.config.Configuration {
5353
class "ConfigurationBase" as src.models.config.ConfigurationBase {
5454
model_config
5555
}
56-
class "ConversationCacheConfiguration" as src.models.config.ConversationCacheConfiguration {
56+
class "ConversationHistoryConfiguration" as src.models.config.ConversationHistoryConfiguration {
5757
memory : Optional[InMemoryCacheConfig]
5858
postgres : Optional[PostgreSQLDatabaseConfiguration]
5959
sqlite : Optional[SQLiteDatabaseConfiguration]
@@ -185,7 +185,7 @@ src.models.config.AuthorizationConfiguration --|> src.models.config.Configuratio
185185
src.models.config.ByokRag --|> src.models.config.ConfigurationBase
186186
src.models.config.CORSConfiguration --|> src.models.config.ConfigurationBase
187187
src.models.config.Configuration --|> src.models.config.ConfigurationBase
188-
src.models.config.ConversationCacheConfiguration --|> src.models.config.ConfigurationBase
188+
src.models.config.ConversationHistoryConfiguration --|> src.models.config.ConfigurationBase
189189
src.models.config.Customization --|> src.models.config.ConfigurationBase
190190
src.models.config.DatabaseConfiguration --|> src.models.config.ConfigurationBase
191191
src.models.config.InMemoryCacheConfig --|> src.models.config.ConfigurationBase

0 commit comments

Comments
 (0)