Skip to content

Commit ec54cdc

Browse files
authored
Bug fixes and enhancements (#4)
1 parent 7b09dd3 commit ec54cdc

File tree

18 files changed

+113
-85
lines changed

18 files changed

+113
-85
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,10 @@ jobs:
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030

31-
#- name: Test API Key
32-
# run: |
33-
# response=$(curl --fail -s -H "Authorization: Bearer ${OPENAI_API_KEY}" https://api.openai.com/v1/engines)
34-
# echo "$response"
35-
# if [ $? -ne 0 ]; then
36-
# echo "API key test failed!"
37-
# exit 1
38-
# fi
39-
# env:
40-
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
41-
42-
- name: Setup
31+
- name: Remove cloud-only modules and install Python client
4332
run: |
4433
set -e
34+
bash scripts/remove_cloud_modules.sh
4535
cd clients/python
4636
python -m pip install .[all]
4737
@@ -98,20 +88,6 @@ jobs:
9888
COMPOSE_DOCKER_CLI_BUILD: 1
9989
DOCKER_BUILDKIT: 1
10090

101-
#- name: Test list models
102-
# run: |
103-
# response=$(curl --fail -s http://localhost:6969/api/v1/models)
104-
# echo "$response"
105-
# if [ $? -ne 0 ]; then
106-
# echo "list models test failed!"
107-
# exit 1
108-
# fi
109-
110-
#- name: Get docker compose logs
111-
# if: always()
112-
# run: |
113-
# docker compose -f docker/compose.cpu.yml logs
114-
11591
- name: Pytest
11692
run: |
11793
set -e

CHANGELOG.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). [An example](https://github.com/standard/standard/blob/master/CHANGELOG.md).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## [Unreleased]
7+
The version number mentioned here refers to the cloud version.
88

9-
This is for a future release.
9+
## [v0.1] - 2024-06-03
1010

11-
### CHANGED
12-
13-
### FIXED
11+
This is our first release 🚀

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- prettier-ignore -->
1010
> [!TIP]
11-
> [Explore our docs](https://docs.jamaibase.com)
11+
> [Explore our docs](#explore-the-documentation)
1212
1313
## Overview
1414

@@ -141,10 +141,10 @@ Get free LLM tokens on JamAI Base Cloud. [Sign up now.](https://cloud.jamaibase.
141141
$ docker compose -f docker/compose.nvidia.yml up --quiet-pull -d
142142
```
143143

144-
<!-- prettier-ignore -->
145-
> [!TIP]
146-
> By default, frontend and backend are accessible at ports 4000 and 6969.
147-
> You can change the ports exposed to host by setting env var like so `API_PORT=6970 FRONTEND_PORT=4001 docker compose -f docker/compose.cpu.yml up --quiet-pull -d`
144+
<!-- prettier-ignore -->
145+
> [!TIP]
146+
> By default, frontend and backend are accessible at ports 4000 and 6969.
147+
> You can change the ports exposed to host by setting env var like so `API_PORT=6970 FRONTEND_PORT=4001 docker compose -f docker/compose.cpu.yml up --quiet-pull -d`
148148
149149
4. Try the command below in your terminal, or open your browser and go to `localhost:4000`.
150150

@@ -156,6 +156,8 @@ Get free LLM tokens on JamAI Base Cloud. [Sign up now.](https://cloud.jamaibase.
156156

157157
- [API Documentation](https://jamaibase.readme.io)
158158
- [Platform Documentation](https://docs.jamaibase.com)
159+
- [Changelog](CHANGELOG.md)
160+
- [Versioning](VERSIONING.md)
159161

160162
## Examples
161163

VERSIONING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Versioning
2+
3+
This document describes the versioning policy for this repository.
4+
5+
# TLDR
6+
7+
We follow [Semantic Versioning](https://semver.org/).
8+
9+
# Current Client SDK Versions (v0.x)
10+
11+
We will start our versioning at `v0.x.x`.
12+
13+
Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
14+
15+
# Future Client SDK Versions (v1.x)
16+
17+
SDK versions will follow this structure `<major>.<minor>.<patch>`:
18+
19+
- `major` is incremented for any backwards-incompatible updates made to our [Cloud service / backend](https://cloud.jamaibase.com/) and hence our SDK.
20+
- `minor` or `patch` is incremented for any backwards-compatible feature update, bug fix, enhancements made to the SDK libraries.

clients/python/src/jamaibase/protocol.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,13 @@ def handle_nulls_and_validate(self) -> Self:
12061206
if k in failed_cols:
12071207
d[k], state["original"] = None, d[k]
12081208
if d[k] is None:
1209-
if col.dtype == DtypeEnum.str_:
1209+
if col.dtype == DtypeEnum.int_:
1210+
d[k] = 0
1211+
elif col.dtype == DtypeEnum.float_:
1212+
d[k] = 0.0
1213+
elif col.dtype == DtypeEnum.bool_:
1214+
d[k] = False
1215+
elif col.dtype == DtypeEnum.str_:
12101216
# Store null string as ""
12111217
# https://github.com/lancedb/lancedb/issues/1160
12121218
d[k] = ""

clients/python/src/jamaibase/utils/io.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import orjson
1515
import srsly
1616
import toml
17-
from jamaibase.utils.types import JSONInput, JSONOutput
1817
from PIL import ExifTags, Image
1918

19+
from jamaibase.utils.types import JSONInput, JSONOutput
20+
2021
logger = logging.getLogger(__name__)
2122

2223

@@ -49,7 +50,7 @@ def dump_json(data: JSONInput, path: str, **kwargs) -> str:
4950
Args:
5051
data (JSONInput): The data.
5152
path (str): Path to the file.
52-
**kwargs: Other keyword arguments to pass into `srsly.write_json`.
53+
**kwargs: Other keyword arguments to pass into `orjson.dumps`.
5354
5455
Returns:
5556
path (str): Path to the file.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.1"
1+
__version__ = "0.1.0"

scripts/remove_cloud_modules.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env bash
22

3-
set -e
4-
53
find . -type f -name "cloud*.py" -delete
64
find . -type f -name "compose.*.cloud.yml" -delete
75
find . -type d -name "(cloud)" -exec rm -rf {} +
8-
rm services/app/ecosystem.config.cjs
9-
rm services/app/ecosystem.json
6+
rm -f services/app/ecosystem.config.cjs
7+
rm -f services/app/ecosystem.json

services/api/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ dependencies = [
7878
"lancedb~=0.6.13",
7979
"langchain-community~=0.0.25",
8080
"langchain~=0.1.10",
81-
"litellm~=1.35.15",
81+
"litellm~=1.40.0",
8282
"loguru~=0.7.2",
8383
"matplotlib",
8484
"numpy~=1.26.4",
85-
"openai~=1.23.1",
85+
"openai~=1.30.5",
8686
"openmeter~=1.0.0b50",
8787
"orjson~=3.9.15",
88+
"Pillow~=10.3.0",
8889
"pyarrow==15.0.0",
8990
"pycryptodomex~=3.20.0",
9091
"pydantic-settings>=2.2.1",
@@ -93,9 +94,11 @@ dependencies = [
9394
"python-multipart~=0.0.6",
9495
"redis[hiredis]~=5.0.4",
9596
"sqlmodel~=0.0.16",
97+
"srsly~=2.4.8",
9698
"stripe~=8.5.0",
9799
"tantivy~=0.21.0",
98100
"tiktoken~=0.6.0",
101+
"toml~=0.10.2",
99102
"tqdm~=4.66.2",
100103
"typer[all]~=0.9.0",
101104
"typing_extensions>=4.10.0",

services/api/src/owl/db/gen_table.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from filelock import FileLock
1313
from lancedb.table import LanceTable
1414
from loguru import logger
15-
from pydantic import BaseModel
1615
from sqlalchemy import desc
1716
from sqlmodel import Session, SQLModel, select
1817
from typing_extensions import Self
@@ -67,7 +66,7 @@ def __init__(
6766
self.db_url = Path(db_url)
6867
self.vector_db_url = Path(vector_db_url)
6968

70-
def lock(self, name: str, timeout: int = 60):
69+
def lock(self, name: str, timeout: int = 5):
7170
name = f"{self.lock_name_prefix}/{name}.lock"
7271
self.locks[name] = self.locks.get(name, FileLock(name, timeout=timeout))
7372
return self.locks[name]

0 commit comments

Comments
 (0)