Changelog
This package is already used in production at Tune AI, please do not wait for release 1.x.x for stability, or expect
to reach 1.0.0. We do not follow the general rules of semantic versioning, and there can be breaking changes between
minor versions.
All relevant steps to be taken will be mentioned here.
8.0.3
Fix bug in
toolsthat was causing ever increasing number of tools in theThreadobjectOpenAI protocol abstracted away as a
OpenAIProtocolclass intuneapi.apis.openai. This is to make it easier to add new endpoints in the future.
8.0.2
Added usage tracking for OpenAI and Anthropic
8.0.1
Typo so now we are in 8.x.x series
Fix bug in structured generation for
Openai.
0.8.0
Adding multimodal support for OpenAI and Gemini endpoints.
Added new types for the new endpoints, etc.
New utils function
file_sizeto get the size of the file in bytes.
0.7.4
Remove
model_tune.py,model_groq.pyandmodel_mistral.pyand subclass those models fromOpenai.
0.7.3
Fix bug in image modality for Gemini
Fix bug in structured generation for OpenAI by setting
strict=Truein the API.Fix bug in structured generation for Gemini
Abstracted making input structure for
Anthropic,OpenAIandGeminiusing_process_inputmethodAbstracted outputs for
Anthropic,OpenAIandGeminiusing_process_outputmethod
0.7.2
Add image modality for Gemini and OpenAI to complement Anthropic.
0.7.1
Add structured genration support for Gemini and OpenAI APIs. You can jsut pass
schematoThread.model.chatwill take care of it automatically. Here’s an example:from tuneapi import tt, ta from pydantic import BaseModel from typing import List, Optional, Dict, Any class MedicalRecord(BaseModel): date: str diagnosis: str treatment: str class Dog(BaseModel): name: str breed: str records: Optional[List[MedicalRecord]] = None class Dogs(BaseModel): dogs: List[Dog] model = ta.Gemini() out: Dogs = model.chat(tt.Thread( tt.human(""" At the Sunny Paws Animal Clinic, we keep detailed records of all our furry patients. Today, we saw a few dogs. There was 'Buddy,' a golden retriever, who visited on '2023-10-26' and was diagnosed with a 'mild ear infection,' which we treated with 'ear drops.' Then, there was 'Luna,' a playful beagle, who came in on '2023-10-25' for a 'routine check-up,' and no treatment was needed, but we also had her back on '2023-10-28' with a 'upset tummy' which we treated with 'bland diet and probiotics.' Finally, a third dog named 'Rocky', a small terrier mix, showed up on '2023-10-29' with a small 'cut on his paw,' we cleaned it and used an 'antibiotic ointment'. We also have 'Daisy,' a fluffy poodle, who doesn't have any medical records yet, thankfully! """), schema=Dogs, )) for dog in out.dogs: print(f"Dog: {dog.name}, Breed: {dog.breed}") if dog.records: for record in dog.records: print(f" Date: {record.date}, Diagnosis: {record.diagnosis}, Treatment: {record.treatment}") else: print(" No medical records on file.") print()
Add
pydanticas a dependency in the package.
0.7.0
All models now have
<model>.distributed_chat_asyncthat can be used in servers without blocking the main event loop. This will give a much needed UX improvement to the entire system.
0.6.3
<model>.distributed_chatnow takes in args that are passed to thepost_logic.
0.6.2
New set of utils in
tuneapi.utilscalledpromptto help with the basics of prompting.
0.6.1
Package now uses
fire==0.7.0
0.6.0
distributed_chatfunctionality intuneapi.apis.turbosupport. In all APIs search formodel.distributed_chat()method. This enables fault tolerant LLM API calls.Moved
tuneapi.types.experimentaltotuneapi.types.evals
0.5.13
tuneapi.types.ModelInterfacehas anextra_headersattribute in it.
0.5.12
Remove code to sanitize assistant message in for Tune and OpenAI LLM APIs.
0.5.11
Fix bug where
parallel_tool_callswas sent even for non tool calls.
0.5.10
Remove redundant prints.
0.5.9
By default set the value
parallel_tool_callsin OpenAI toFalse.
0.5.8
If you have
numpyinstalled in your environment, thentuneapi.utils.randomness.reservoir_samplingwill honour the seed value. If you do not havenumpyinstalled, then the seed value will be ignored.Fix Bug in Gemini API body for functions with no parameters.
0.5.7
Implement
extra_headersvia__init__as well.
0.5.6
Remove protobuf as a dependency in because bunch of other packages break. The functions are still present
0.5.5
In all implmenetations of
tuneapi.types.chats.ModelInterfaceadd new input to the API endpoints calledextra_headerswhich is a dictionary to update the outgoing headers.
0.5.4
Standardise
tuneapi.types.chats.ModelInterfaceto havemodel_id,api_tokenadded to the base class.
0.5.3
Fix bug in Tune proxy API where incorrect variable
stop_sequencewas sent instead of the correctstopcausing incorrect behaviour.bump dependency to
protobuf>=5.27.3remove
__version__from tuneapi packageremove CLI entrypoint in
pyproject.toml
0.5.2
Add ability to upload any file using
tuneapi.endpoints.FinetuningAPI.upload_dataset_fileto support the existing way to uploading using threads.
0.5.1
Fix bug in the endpoints module where error was raised despite correct inputs
0.5.0 (breaking)
In this release we have moved all the Tune Studio specific API out of tuneapi.apis to tuneapi.endpoints to avoid
cluttering the apis namespace.
- from tuneapi import apis as ta
+ from tuneapi import endpoints as te
...
- ta.ThreadsAPI(...)
+ te.ThreadsAPI(...)
Add support for finetuning APIs with
tuneapi.endpoints.FinetuningAPIPrimary environment variables have been changed from
TUNE_API_KEYtoTUNEAPI_TOKENand fromTUNE_ORG_IDtoTUNEORG_ID, if you were using these please update your environment variablesRemoved CLI methods
test_modelsandbenchmark_models, if you want to use those, please copy the code from this commit
0.4.18
Fix bug where function response was tried to be deserialised to the JSON and then sent to the different APIs.
0.4.17
Fix error in
tuneapi.utils.serdeser.to_s3function where content type key was incorrect
0.4.16
Adding support for python 3.12
Adding
toolas a valid role intuneapi.types.chats.Message
0.4.15
When there is an error in the model API, we used to print the error message. Now we are returning the error message in the response.
0.4.14
Fix bug where a loose
pydanticimport was present
0.4.13
Bug fixes in JSON deserialisation
0.4.12
Fix bug in Threads API where incorrect structure was sent by client
Add images support for Anthropic API
Add
Message.imagesfield to store all images