Skip to content

chore: converse b64 to bytes conversion raises error with more clarity #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
057e4fb
chore: Provider Unit Tests (#173)
MiNeves00 Dec 18, 2024
2cd3f94
[fix] bump prerelease version in pyproject.toml
actions-user Dec 18, 2024
cdeb84f
chore: rename action
diogoncalves Dec 18, 2024
f9feb73
feat: added action to run tests on PR
diogoncalves Dec 18, 2024
95c1723
chore: comments
diogoncalves Dec 18, 2024
8ea43c6
fix: fix azure config tests
diogoncalves Dec 18, 2024
9f42faa
chore: style format
diogoncalves Dec 18, 2024
91f232e
fix: tests workflow
diogoncalves Dec 18, 2024
ee7c373
Feature/prompt management (#200)
brunoalho99 Jan 23, 2025
549e388
[fix] bump prerelease version in pyproject.toml
actions-user Jan 23, 2025
c6cdad0
[bugfix] return empty prompt
brunoalho99 Jan 29, 2025
8d83a45
[bugfix] return empty prompt (#201)
brunoalho99 Jan 29, 2025
2a5b4fb
[fix] bump prerelease version in pyproject.toml
actions-user Jan 29, 2025
d330303
Update CONTRIBUTING.md
diogoncalves Jan 29, 2025
21e9352
Feat/ Use Openai Usage to calculate Cache and Reasoning Costs (#199)
MiNeves00 Jan 30, 2025
c23dfae
chore: update poetry.lock
diogoncalves Jan 30, 2025
2660006
chore: specify python versions
diogoncalves Jan 30, 2025
8fbe717
chore: moving langchain integration tests to sdk
diogoncalves Jan 30, 2025
29e39d8
chore: format
diogoncalves Jan 30, 2025
39443df
feat: added support for o3-mini and updated o1-mini prices. also upda…
MiNeves00 Feb 5, 2025
9610bcb
chore: removed duplicated code; removed duplicated integration tests
MiNeves00 Feb 10, 2025
7b9a866
chore: updated github actions to run integration tests
MiNeves00 Feb 10, 2025
c231e91
chore: fixing github actions
MiNeves00 Feb 10, 2025
0503810
chore: fixing github actions again
MiNeves00 Feb 10, 2025
30e4fa6
chore: fixing github actions again-x2
MiNeves00 Feb 10, 2025
91562b3
chore: fixing github actions again-x2
MiNeves00 Feb 10, 2025
545d990
chore: added cache of dependencies to integration-tests in githubaction
MiNeves00 Feb 10, 2025
ddc250f
chore: updated integration-tests action to inject github secrets into…
MiNeves00 Feb 10, 2025
83d7b55
Feat/bedrock support for Nova models through the ConverseAPI (#207)
MiNeves00 Feb 12, 2025
74e6b4f
[fix] bump prerelease version in pyproject.toml
actions-user Feb 12, 2025
7840ef4
[fix] bump prerelease version in pyproject.toml
actions-user Feb 12, 2025
65d0f22
[fix] bump prerelease version in pyproject.toml
actions-user Feb 12, 2025
162f1af
Update pyproject.toml
MiNeves00 Feb 12, 2025
10a604d
[fix] bump prerelease version in pyproject.toml
actions-user Feb 12, 2025
92223ea
chore: updated llmstudio sdk poetry.lock
MiNeves00 Feb 12, 2025
2a9ae25
Feat/converse support images (#211)
MiNeves00 Mar 3, 2025
986e3e8
[fix] bump prerelease version in pyproject.toml
actions-user Mar 3, 2025
f41c13a
chore: converse b64 to bytes conversion raises error with more clarity
MiNeves00 Mar 5, 2025
9f89d19
chore: better naming of b64 and b64dataurl
MiNeves00 Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Tests

on:
pull_request:
branches:
- main
- develop
types:
- opened
- synchronize
- reopened

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ">=3.9 <3.13"

# Install Poetry
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -

# Cache Poetry Dependencies
- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-

# Install lib and dev dependencies
- name: Install llmstudio-core
working-directory: ./libs/core
run: |
poetry install
UNIT_ENV=$(poetry env info --path)
echo $UNIT_ENV
echo "UNIT_ENV=$UNIT_ENV" >> $GITHUB_ENV

- name: Run unit tests
run: |
echo ${{ env.UNIT_ENV }}
source ${{ env.UNIT_ENV }}/bin/activate
poetry run pytest libs/core

integration-tests:
needs: unit-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ">=3.9 <3.13"

# Install Poetry
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -

# Inject Secrets as Environment Variables
- name: Set up environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" >> $GITHUB_ENV
echo "BEDROCK_ACCESS_KEY=${{ secrets.BEDROCK_ACCESS_KEY }}" >> $GITHUB_ENV
echo "BEDROCK_SECRET_KEY=${{ secrets.BEDROCK_SECRET_KEY }}" >> $GITHUB_ENV
echo "BEDROCK_REGION=${{ secrets.BEDROCK_REGION }}" >> $GITHUB_ENV

# Cache Poetry Dependencies
- name: Cache Poetry dependencies (Integration Tests)
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-integration-${{ runner.os }}-${{ hashFiles('libs/llmstudio/poetry.lock') }}
restore-keys: |
poetry-integration-${{ runner.os }}-

# Install llmstudio
- name: Install llmstudio
working-directory: ./libs/llmstudio
run: |
poetry install
INTEGRATION_ENV=$(poetry env info --path)
echo $INTEGRATION_ENV
echo "INTEGRATION_ENV=$INTEGRATION_ENV" >> $GITHUB_ENV

# Run Integration Tests
- name: Run Integration Tests
run: |
source ${{ env.INTEGRATION_ENV }}/bin/activate
poetry run pytest libs/llmstudio/tests/integration_tests
2 changes: 1 addition & 1 deletion .github/workflows/upload-pypi-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyPI prerelease and build/push Docker image.
name: PyPI prerelease any module.

on:
workflow_dispatch:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ env3
.env*
.env*.local
.venv*
*venv*
env*/
venv*/
ENV/
Expand All @@ -66,6 +67,7 @@ venv.bak/
config.yaml
bun.lockb


# Jupyter Notebook
.ipynb_checkpoints

Expand All @@ -76,4 +78,4 @@ bun.lockb
llmstudio/llm_engine/logs/execution_logs.jsonl
*.db
.prettierignore
db
db
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,30 @@ Thank you for expressing your interest in contributing to LLMstudio. To ensure t
3. Follow our repo guidelines
- Ensure that you update any relevant docstrings and comments within your code
- Run `pre-commit run --all-files` to lint your code
4. Sign your commits. Without signed commits, your changes will not be accepted for main.

## Branches

- All development happens in per-feature branches prefixed by contributor's
initials. For example `feat/feature_name`.
- Approved PRs are merged to the `main` branch.

## Alpha releases:
You need to have your changes in the `develop` branch in order to push a new alpha version of any library `(llmstudio, llmstudio-proxy, llmstudio-tracker)`. Therefore, first guarantee that you feature branch is reviewed and working before merging to develop.

Process:
- Ensure the `feature/**` you worked is passing the tests and has the approvals necessary.
- Merge to `develop`
- Ensure the changes are in the develop branch
- Use GitHub Actions to initiate the pre-release process: [PyPI pre-release any module](https://github.com/TensorOpsAI/LLMstudio/actions/workflows/upload-pypi-dev.yml)
- Select the target library `(llmstudio, llmstudio-proxy, llmstudio-tracker)` and the target version for the final release (e.g., 1.1.0). Consult main branch and PyPI for current versions.
- Run the workflow.
- The workflow will automatically bump the version and create an alpha release of the library/module specified
- The workflow will automatically push changes back (bump version) to the develop branch

Repeat the process in case your `development` branch contains changes in multiple libraries.

## Final releases:
Once you're happy with the versions, create the Release notes on the PR between `develop` and `main` and merge to main branch when ready for full release. The workflow will automatically remove any `alpha` tag in your libraries and push the versions for every library/module that suffered changes.


3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
format:
pre-commit run --all-files

unit-tests:
pytest libs/core/tests/unit_tests
17 changes: 15 additions & 2 deletions examples/_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,29 @@ providers:
keys:
- OPENAI_API_KEY
models:
o1-preview:
mode: chat
max_completion_tokens: 128000
input_token_cost: 0.000015
output_token_cost: 0.000060
o1-mini:
mode: chat
max_completion_tokens: 128000
input_token_cost: 0.000003
cached_token_cost: 0.0000015
output_token_cost: 0.000012
gpt-4o-mini:
mode: chat
max_tokens: 128000
input_token_cost: 0.00000015
cached_token_cost: 0.000000075
output_token_cost: 0.00000060
gpt-4o:
mode: chat
max_tokens: 128000
input_token_cost: 0.000005
output_token_cost: 0.000015
input_token_cost: 0.0000025
cached_token_cost: 0.00000125
output_token_cost: 0.00001
gpt-4-turbo:
mode: chat
max_tokens: 128000
Expand Down
Loading