Skip to content

Commit 5ccb7e2

Browse files
committed
documentation: create v0 documentation
1 parent 4ca6898 commit 5ccb7e2

61 files changed

Lines changed: 5699 additions & 1656 deletions

Some content is hidden

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

.github/compose.ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ services:
77
dockerfile: api/Dockerfile
88
restart: always
99
env_file: "${APP_ENV_FILE:-.env.ci}"
10-
volumes:
11-
- ../scripts/generate_configuration_documentation.py:/scripts/generate_configuration_documentation.py:ro
1210
ports:
1311
- 8000:8000
1412
environment:

.github/workflows/generate_documentation.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,26 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- name: Checkout du code
17+
uses: actions/checkout@v4
1718

18-
- name: Set up Docker Compose
19-
run: |
20-
cp .github/.env.ci.example .github/.env.ci
21-
sed -i 's/^\([A-Z_]*\)_HOST=localhost/\1_HOST=\L\1/' .github/.env.ci
22-
make test-integ action=up execute=docker
23-
env:
24-
BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }}
25-
ALBERT_API_KEY: ${{ secrets.ALBERT_API_KEY }}
26-
CS_API_KEY: ${{ secrets.CS_API_KEY }}
19+
- name: Configure Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.12'
2723

28-
- name: Generate configuration documentation
29-
run: |
30-
docker compose -f .github/compose.ci.yml --env-file .github/.env.ci run -T --user $(id -u):$(id -g) -v $(pwd)/api:/api api \
31-
python /scripts/generate_configuration_documentation.py --output /api/configuration.md
32-
33-
cat ./api/configuration.md > ./docs/docs/getting-started/configuration.md
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install ".[api,dev]"
3428
35-
- name: Commit configuration documentation
36-
uses: stefanzweifel/git-auto-commit-action@v4
37-
with:
38-
commit_message: Update configuration documentation
39-
file_pattern: ./docs/getting-started/configuration.md
29+
- name: Generate documentation
30+
run: |
31+
PYTHONPATH=. python ./scripts/docs/generate_configuration_documentation.py --output ./docs/docs/getting-started/configuration.md
32+
PYTHONPATH=. python ./scripts/docs/convert_notebooks_to_docs.py --input ./docs/tutorials --output ./docs/docs/guides
33+
34+
- name: Commit documentation
35+
uses: stefanzweifel/git-auto-commit-action@v4
36+
with:
37+
commit_message: Update docs
38+
file_pattern: ./docs/getting-started/configuration.md ./docs/docs/guides/*.md

CONTRIBUTING.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,3 @@ Then apply the migration with the following command:
178178
```bash
179179
alembic -c playground/alembic.ini upgrade head
180180
```
181-
182-
## Generate configuration documentation
183-
184-
To generate the configuration documentation, you can use the following command:
185-
186-
```bash
187-
python scripts/generate_configuration_documentation.py
188-
```
189-
190-
> [!NOTE]
191-
> This will generate the configuration documentation in the *[docs/docs/getting-started/configuration.md](./docs/docs/getting-started/configuration.md)* file from the [configuration schema](./api/schemas/core/configuration.py) with the [configuration header](./scripts/configuration_header.md).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<img src="./docs/static/img/ogl_logo.svg" alt="Logo" width="128" height="128">
77

88
# OpenGateLLM
9-
[Documentation](https://docs.opengatellm.etalab.gouv.fr) | [API Reference](https://albert.api.etalab.gouv.fr/documentation)
9+
### **[Documentation](https://docs.opengatellm.etalab.gouv.fr) | [API Reference](https://albert.api.etalab.gouv.fr/documentation)**
1010

1111
> [!WARNING]
1212
> **The API is still under beta version, major breaking changes may occur.**

api/schemas/core/configuration.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
from api.utils.variables import (
1616
DEFAULT_APP_NAME,
1717
DEFAULT_TIMEOUT,
18-
ROUTER__AUTH,
1918
ROUTER__ADMIN,
19+
ROUTER__AUTH,
2020
ROUTERS,
2121
)
2222

@@ -118,7 +118,7 @@ class ModelProvider(ConfigBaseModel):
118118
model_name: constr(strip_whitespace=True, min_length=1) = Field(..., description="Model name from the model provider.", examples=["gpt-4o"]) # fmt: off
119119
model_cost_prompt_tokens: float = Field(default=0.0, ge=0.0, description="Model costs prompt tokens for user budget computation. The cost is by 1M tokens.", examples=[0.1]) # fmt: off
120120
model_cost_completion_tokens: float = Field(default=0.0, ge=0.0, description="Model costs completion tokens for user budget computation. The cost is by 1M tokens.", examples=[0.1]) # fmt: off
121-
model_carbon_footprint_zone: CountryCodes = Field(default=CountryCodes.WOR, description="Model hosting zone for carbon footprint computation (with ISO 3166-1 alpha-3 code format). For more information, see https://ecologits.ai", examples=["WOR"]) # fmt: off
121+
model_carbon_footprint_zone: CountryCodes = Field(default=CountryCodes.WOR, description="Model hosting zone using ISO 3166-1 alpha-3 code format (e.g., `WOR` for World, `FRA` for France, `USA` for United States). This determines the electricity mix used for carbon intensity calculations. For more information, see https://ecologits.ai", examples=["WOR"]) # fmt: off
122122
model_carbon_footprint_total_params: Optional[float] = Field(default=None, ge=0.0, description="Total params of the model in billions of parameters for carbon footprint computation. If not provided, the active params will be used if provided, else carbon footprint will not be computed. For more information, see https://ecologits.ai", examples=[8]) # fmt: off
123123
model_carbon_footprint_active_params: Optional[float] = Field(default=None, ge=0.0, description="Active params of the model in billions of parameters for carbon footprint computation. If not provided, the total params will be used if provided, else carbon footprint will not be computed. For more information, see https://ecologits.ai", examples=[8]) # fmt: off
124124

@@ -251,10 +251,6 @@ class BraveDependency(ConfigBaseModel):
251251
timeout: int = Field(default=DEFAULT_TIMEOUT, ge=1, description="Timeout for the Brave API requests.", examples=[10]) # fmt: off
252252

253253

254-
class CentraleSupelecDependency(ConfigBaseModel):
255-
token: str = Field(description="Centrale Supélec token for testing dynamic models")
256-
257-
258254
@custom_validation_error(url="https://github.com/etalab-ia/opengatellm/blob/main/docs/configuration.md#duckduckgodependency")
259255
class DuckDuckGoDependency(ConfigBaseModel):
260256
url: constr(strip_whitespace=True, min_length=1) = Field(default="https://api.duckduckgo.com/", description="DuckDuckGo API url.") # fmt: off
@@ -341,7 +337,6 @@ class EmptyDepencency(ConfigBaseModel):
341337
class Dependencies(ConfigBaseModel):
342338
albert: Optional[AlbertDependency] = Field(default=None, description="If provided, Albert API is used to parse pdf documents. Cannot be used with Marker dependency concurrently. Pass arguments to call Albert API in this section.") # fmt: off
343339
brave: Optional[BraveDependency] = Field(default=None, description="If provided, Brave API is used to web search. Cannot be used with DuckDuckGo dependency concurrently. Pass arguments to call API in this section. All query parameters are supported, see https://api-dashboard.search.brave.com/app/documentation/web-search/query for more information.") # fmt: off
344-
centralesupelec: Optional[CentraleSupelecDependency] = Field(default=None, description="Needed to pass tests where models are added")
345340
duckduckgo: Optional[DuckDuckGoDependency] = Field(default=None, description="If provided, DuckDuckGo API is used to web search. Cannot be used with Brave dependency concurrently. Pass arguments to call API in this section. All query parameters are supported, see https://www.searchapi.io/docs/duckduckgo-api for more information.") # fmt: off
346341
elasticsearch: Optional[ElasticsearchDependency] = Field(default=None, description="Pass all elastic python SDK arguments, see https://elasticsearch-py.readthedocs.io/en/v9.0.2/api/elasticsearch.html#elasticsearch.Elasticsearch for more information.") # fmt: off
347342
qdrant: Optional[QdrantDependency] = Field(default=None, description="Pass all qdrant python SDK arguments, see https://python-client.qdrant.tech/qdrant_client.qdrant_client for more information.") # fmt: off
@@ -494,7 +489,7 @@ def validate_model(cls, values) -> Any:
494489
@custom_validation_error(url="https://github.com/etalab-ia/opengatellm/blob/main/docs/configuration.md#all-configuration")
495490
class ConfigFile(ConfigBaseModel):
496491
"""
497-
Refer to the [configuration example file](../../../config.example.yml) for an example of configuration.
492+
Refer to the [configuration example file](https://github.com/etalab-ia/OpenGateLLM/blob/main/config.example.yml) for an example of configuration.
498493
"""
499494

500495
models: List[Model] = Field(min_length=1, description="Models used by the API. At least one model must be defined.") # fmt: off

docs-legacy/budget.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs-legacy/config.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs-legacy/environmental_footprint.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)